Crate manifest_feature_gen
source ·Expand description
manifest-feature-gen helps generating features of cargo manifest
§Usage
ⓘ
use manifest_feature_gen::{Manifest, ToFeatureName};
enum Features {
Feature1,
Feature2,
}
impl ToFeatureName for Features {
fn to_feature_name(&self) -> String {
unimplemented!()
}
}
fn main() -> Result<(), manifest_feature_gen::Error> {
let mut manifest = Manifest::new_with_env(true)?;
let optional_features = manifest.add_features([
Features::Feature1,
Features::Feature2,
].into_iter(), |_, _| {}).unwrap();
manifest.write()?;
Ok(())
}
Structs§
- This helper provides some safe way to specify dependency of generated feature
- Cargo manifest representation for editing features.
Enums§
- Possible dependency error from
DependencyHelper
- Possible errors while using manifest-feature-gen
Traits§
- Provide feature name for write to cargo manifest. Recommend write in snake_case or kebab-case