Struct escargot::CargoBuild [−][src]
The build
subcommand.
Example
extern crate escargot; extern crate assert_fs; let temp = assert_fs::TempDir::new().unwrap(); escargot::CargoBuild::new() .bin("bin") .current_release() .current_target() .manifest_path("tests/fixtures/bin/Cargo.toml") .target_dir(temp.path()) .exec() .unwrap();
Implementations
impl CargoBuild
[src]
pub fn new() -> Self
[src]
Shortcut to create a build
subcommand.
See also Cargo
.
Example
extern crate escargot; extern crate assert_fs; let temp = assert_fs::TempDir::new().unwrap(); escargot::CargoBuild::new() .bin("bin") .manifest_path("tests/fixtures/bin/Cargo.toml") .target_dir(temp.path()) .exec() .unwrap();
pub fn package<S: AsRef<OsStr>>(self, name: S) -> Self
[src]
Build from name
package in workspaces.
Example
extern crate escargot; extern crate assert_fs; let temp = assert_fs::TempDir::new().unwrap(); escargot::CargoBuild::new() .package("bin") .bin("bin") .manifest_path("tests/fixtures/bin/Cargo.toml") .target_dir(temp.path()) .exec() .unwrap();
pub fn bin<S: AsRef<OsStr>>(mut self: Self, name: S) -> Self
[src]
Build only name
binary.
Example
extern crate escargot; extern crate assert_fs; let temp = assert_fs::TempDir::new().unwrap(); escargot::CargoBuild::new() .bin("bin") .manifest_path("tests/fixtures/bin/Cargo.toml") .target_dir(temp.path()) .exec() .unwrap();
pub fn example<S: AsRef<OsStr>>(mut self: Self, name: S) -> Self
[src]
Build only name
example.
Example
extern crate escargot; extern crate assert_fs; let temp = assert_fs::TempDir::new().unwrap(); escargot::CargoBuild::new() .example("example_fixture") .manifest_path("tests/fixtures/example/Cargo.toml") .target_dir(temp.path()) .exec() .unwrap();
pub fn tests(self) -> Self
[src]
Build all tests
Example
extern crate escargot; extern crate assert_fs; let temp = assert_fs::TempDir::new().unwrap(); escargot::CargoBuild::new() .tests() .manifest_path("tests/fixtures/test/Cargo.toml") .target_dir(temp.path()) .exec() .unwrap();
pub fn test<S: AsRef<OsStr>>(self, name: S) -> Self
[src]
Build only name
test.
Example
extern crate escargot; extern crate assert_fs; let temp = assert_fs::TempDir::new().unwrap(); escargot::CargoBuild::new() .test("test") .manifest_path("tests/fixtures/test/Cargo.toml") .target_dir(temp.path()) .exec() .unwrap();
pub fn manifest_path<S: AsRef<OsStr>>(self, path: S) -> Self
[src]
Path to Cargo.toml
pub fn release(self) -> Self
[src]
Build artifacts in release mode, with optimizations.
pub fn current_release(self) -> Self
[src]
Build artifacts in release mode if the current process has, with optimizations.
pub fn target<S: AsRef<OsStr>>(self, triplet: S) -> Self
[src]
Build for the target triplet.
pub fn current_target(self) -> Self
[src]
Build for the current process' triplet.
pub fn target_dir<S: AsRef<OsStr>>(self, dir: S) -> Self
[src]
Directory for all generated artifacts
pub fn all_features(self) -> Self
[src]
Activate all available features
pub fn no_default_features(self) -> Self
[src]
Do not activate the default
feature
pub fn features<S: AsRef<OsStr>>(self, features: S) -> Self
[src]
Space-separated list of features to activate
pub fn arg<S: AsRef<OsStr>>(mut self: Self, arg: S) -> Self
[src]
Manually pass an argument that is unsupported.
Caution: Passing in --
can throw off the API.
pub fn exec(self) -> CargoResult<CommandMessages>
[src]
Build the configured target, returning compiler messages.
pub fn run(self) -> CargoResult<CargoRun>
[src]
Provide a proxy for running the built target.
Example
extern crate escargot; extern crate assert_fs; let temp = assert_fs::TempDir::new().unwrap(); let run = escargot::CargoBuild::new() .bin("bin") .current_release() .current_target() .manifest_path("tests/fixtures/bin/Cargo.toml") .target_dir(temp.path()) .run() .unwrap(); println!("artifact={}", run.path().display());
pub fn run_tests(
self
) -> CargoResult<impl Iterator<Item = Result<CargoTest, CargoError>>>
[src]
self
) -> CargoResult<impl Iterator<Item = Result<CargoTest, CargoError>>>
Provide a proxy for running the built target.
Required feature: test_unstable
since the format parsed is unstable.
Example
extern crate escargot; extern crate assert_fs; let temp = assert_fs::TempDir::new().unwrap(); let run = escargot::CargoBuild::new() .test("test") .current_release() .current_target() .manifest_path("tests/fixtures/test/Cargo.toml") .target_dir(temp.path()) .run_tests().unwrap() .next().unwrap().unwrap(); println!("artifact={}", run.path().display());
Trait Implementations
impl Default for CargoBuild
[src]
Auto Trait Implementations
impl !RefUnwindSafe for CargoBuild
[src]
impl Send for CargoBuild
[src]
impl Sync for CargoBuild
[src]
impl Unpin for CargoBuild
[src]
impl !UnwindSafe for CargoBuild
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,