Struct cargo_manifest::Product [−][src]
pub struct Product { pub path: Option<String>, pub name: Option<String>, pub test: bool, pub doctest: bool, pub bench: bool, pub doc: bool, pub plugin: bool, pub proc_macro: bool, pub harness: bool, pub edition: Option<Edition>, pub required_features: Vec<String>, pub crate_type: Option<Vec<String>>, }
Cargo uses the term “target” for both “target platform” and “build target” (the thing to build), which makes it ambigous. Here Cargo’s bin/lib target is renamed to product.
Fields
path: Option<String>
This field points at where the crate is located, relative to the Cargo.toml
.
name: Option<String>
The name of a product is the name of the library or binary that will be generated.
This is defaulted to the name of the package, with any dashes replaced
with underscores. (Rust extern crate
declarations reference this name;
therefore the value must be a valid Rust identifier to be usable.)
test: bool
A flag for enabling unit tests for this product. This is used by cargo test
.
doctest: bool
A flag for enabling documentation tests for this product. This is only relevant
for libraries, it has no effect on other sections. This is used by
cargo test
.
bench: bool
A flag for enabling benchmarks for this product. This is used by cargo bench
.
doc: bool
A flag for enabling documentation of this product. This is used by cargo doc
.
plugin: bool
If the product is meant to be a compiler plugin, this field must be set to true for Cargo to correctly compile it and make it available for all dependencies.
proc_macro: bool
If the product is meant to be a “macros 1.1” procedural macro, this field must be set to true.
harness: bool
If set to false, cargo test
will omit the --test
flag to rustc, which
stops it from generating a test harness. This is useful when the binary being
built manages the test runner itself.
edition: Option<Edition>
If set then a product can be configured to use a different edition than the
[package]
is configured to use, perhaps only compiling a library with the
2018 edition or only compiling one unit test with the 2015 edition. By default
all products are compiled with the edition specified in [package]
.
required_features: Vec<String>
The required-features field specifies which features the product needs in order to be built.
If any of the required features are not selected, the product will be skipped.
This is only relevant for the [[bin]]
, [[bench]]
, [[test]]
, and [[example]]
sections,
it has no effect on [lib]
.
crate_type: Option<Vec<String>>
The available options are “dylib”, “rlib”, “staticlib”, “cdylib”, and “proc-macro”.
Trait Implementations
impl Clone for Product
[src]
impl Debug for Product
[src]
impl Default for Product
[src]
impl<'de> Deserialize<'de> for Product
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl PartialEq<Product> for Product
[src]
impl Serialize for Product
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralPartialEq for Product
[src]
Auto Trait Implementations
impl RefUnwindSafe for Product
impl Send for Product
impl Sync for Product
impl Unpin for Product
impl UnwindSafe for Product
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> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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>,