Struct cargo_metadata::MetadataCommand [−][src]
pub struct MetadataCommand { /* fields omitted */ }
Expand description
A builder for configurating cargo metadata
invocation.
Implementations
Creates a default cargo metadata
command, which will look for
Cargo.toml
in the ancestors of the current directory.
Path to cargo
executable. If not set, this will use the
the $CARGO
environment variable, and if that is not set, will
simply be cargo
.
Path to Cargo.toml
Current directory of the cargo metadata
process.
Output information only about the root package and don’t fetch dependencies.
Which features to include.
Call this multiple times to specify advanced feature configurations:
MetadataCommand::new()
.features(CargoOpt::NoDefaultFeatures)
.features(CargoOpt::SomeFeatures(vec!["feat1".into(), "feat2".into()]))
.features(CargoOpt::SomeFeatures(vec!["feat3".into()]))
// ...
Panics
cargo metadata
rejects multiple --no-default-features
flags. Similarly, the features()
method panics when specifying multiple CargoOpt::NoDefaultFeatures
:
MetadataCommand::new()
.features(CargoOpt::NoDefaultFeatures)
.features(CargoOpt::NoDefaultFeatures) // <-- panic!
// ...
The method also panics for multiple CargoOpt::AllFeatures
arguments:
MetadataCommand::new()
.features(CargoOpt::AllFeatures)
.features(CargoOpt::AllFeatures) // <-- panic!
// ...
Arbitrary command line flags to pass to cargo
. These will be added
to the end of the command line invocation.
Builds a command for cargo metadata
. This is the first
part of the work of exec
.
Parses cargo metadata
output. data
must have been
produced by a command built with cargo_command
.
Trait Implementations
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for MetadataCommand
impl Send for MetadataCommand
impl Sync for MetadataCommand
impl Unpin for MetadataCommand
impl UnwindSafe for MetadataCommand
Blanket Implementations
Mutably borrows from an owned value. Read more