/// Which features to include.
///
/// Call this multiple times to specify advanced feature configurations:
///
/// ```no_run
/// # use cargo_metadata::{CargoOpt, MetadataCommand};
/// 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`:
///
/// ```should_panic
/// # use cargo_metadata::{CargoOpt, MetadataCommand};
/// MetadataCommand::new()
///     .features(CargoOpt::NoDefaultFeatures)
///     .features(CargoOpt::NoDefaultFeatures) // <-- panic!
///     // ...
///     # ;
/// ```
///
/// The method also panics for multiple `CargoOpt::AllFeatures` arguments:
///
/// ```should_panic
/// # use cargo_metadata::{CargoOpt, MetadataCommand};
/// MetadataCommand::new()
///     .features(CargoOpt::AllFeatures)
///     .features(CargoOpt::AllFeatures) // <-- panic!
///     // ...
///     # ;
/// ```
Which features to include.
Call this multiple times to specify advanced feature configurations.


Which features to include . Call this multiple times to specify advanced feature configurations .
pub fn features(&mut self, features: CargoOpt) -> &mut MetadataCommand {
        match features {
            CargoOpt::SomeFeatures(features) => self.features.extend(features),
            CargoOpt::NoDefaultFeatures => {
                assert!(
                    !self.no_default_features,
                    "Do not supply CargoOpt::NoDefaultFeatures more than once!"
                );
                self.no_default_features = true;
            }
            CargoOpt::AllFeatures => {
                assert!(
                    !self.all_features,
                    "Do not supply CargoOpt::AllFeatures more than once!"
                );
                self.all_features = true;
            }
        }
        self
    }
pub fn features ( & mut self , features : CargoOpt ) -> & mut MetadataCommand { match features { CargoOpt :: SomeFeatures ( features ) => self . features . extend ( features ) , CargoOpt :: NoDefaultFeatures => { assert ! ( self no_default_features " " ) ; self . no_default_features = true ; } CargoOpt :: AllFeatures => { assert ! ( self all_features " " ) ; self . all_features = true ; } } self }
Which features to include.
Which features to include .
&mut self
features
CargoOpt
use cargo_metadata::{cargoopt, metadatacommand};
:new()
.features(CargoOpt::NoDefaultFeatures)
.features(CargoOpt::SomeFeatures(vec!["feat1".into(), "feat2".into()]))
.features(CargoOpt::SomeFeatures(vec!["feat3".into()]))

;
```
: 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`.


` cargo metadata ` rejects multiple ` -- no - default - features ` flags . Similarly the ` features () ` method panics when specifying multiple ` CargoOpt :: NoDefaultFeatures ` .
use cargo_metadata::{cargoopt, metadatacommand};
:new()
.features(CargoOpt::NoDefaultFeatures)
.features(CargoOpt::NoDefaultFeatures) // <-- panic.

The method also panics for multiple `CargoOpt::AllFeatures` arguments.


: new () . features ( CargoOpt :: NoDefaultFeatures ) . features ( CargoOpt :: NoDefaultFeatures ) // < -- panic . The method also panics for multiple ` CargoOpt :: AllFeatures ` arguments .
use cargo_metadata::{cargoopt, metadatacommand};
:new()
.features(CargoOpt::AllFeatures)
.features(CargoOpt::AllFeatures) // <-- panic.
: new () . features ( CargoOpt :: AllFeatures ) . features ( CargoOpt :: AllFeatures ) // < -- panic .