Struct escargot::CargoBuild
source · pub struct CargoBuild { /* private fields */ }
Expand description
The build
subcommand.
Example
escargot::CargoBuild::new()
.bin("bin_fixture")
.current_release()
.current_target()
.exec()
.unwrap();
Implementations
sourceimpl CargoBuild
impl CargoBuild
sourcepub fn package<S: AsRef<OsStr>>(self, name: S) -> Self
pub fn package<S: AsRef<OsStr>>(self, name: S) -> Self
Build from name
package in workspaces.
Example
escargot::CargoBuild::new()
.package("escargot")
.bin("bin_fixture")
.exec()
.unwrap();
sourcepub fn example<S: AsRef<OsStr>>(self, name: S) -> Self
pub fn example<S: AsRef<OsStr>>(self, name: S) -> Self
Build only name
example.
Example
escargot::CargoBuild::new()
.example("example_fixture")
.exec()
.unwrap();
sourcepub fn manifest_path<S: AsRef<OsStr>>(self, path: S) -> Self
pub fn manifest_path<S: AsRef<OsStr>>(self, path: S) -> Self
Path to Cargo.toml
sourcepub fn current_release(self) -> Self
pub fn current_release(self) -> Self
Build artifacts in release mode if the current process has, with optimizations.
sourcepub fn current_target(self) -> Self
pub fn current_target(self) -> Self
Build for the current process’ triplet.
sourcepub fn target_dir<S: AsRef<OsStr>>(self, dir: S) -> Self
pub fn target_dir<S: AsRef<OsStr>>(self, dir: S) -> Self
Directory for all generated artifacts
sourcepub fn all_features(self) -> Self
pub fn all_features(self) -> Self
Activate all available features
sourcepub fn no_default_features(self) -> Self
pub fn no_default_features(self) -> Self
Do not activate the default
feature
sourcepub fn features<S: AsRef<OsStr>>(self, features: S) -> Self
pub fn features<S: AsRef<OsStr>>(self, features: S) -> Self
Space-separated list of features to activate
sourcepub fn arg<S: AsRef<OsStr>>(self, arg: S) -> Self
pub fn arg<S: AsRef<OsStr>>(self, arg: S) -> Self
Manually pass an argument that is unsupported.
Caution: Passing in --
can throw off the API.
sourcepub fn exec(self) -> CargoResult<MessageIter>
pub fn exec(self) -> CargoResult<MessageIter>
Build the configured target, returning compiler messages.
sourcepub fn run(self) -> CargoResult<CargoRun>
pub fn run(self) -> CargoResult<CargoRun>
Provide a proxy for running the built target.
Example
let run = escargot::CargoBuild::new()
.bin("bin_fixture")
.current_release()
.current_target()
.run()
.unwrap();
println!("artifact={}", run.path().display());
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for CargoBuild
impl Send for CargoBuild
impl Sync for CargoBuild
impl Unpin for CargoBuild
impl !UnwindSafe for CargoBuild
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more