Struct guppy::graph::feature::FeatureId [−][src]
pub struct FeatureId<'g> { /* fields omitted */ }Expand description
An identifier for a (package, feature) pair in a feature graph.
Returned by various methods on FeatureGraph and FeatureQuery.
From impls are available for (&'g PackageId, &'g str) and (&'g PackageId, Option<&'g str>)
tuples.
Implementations
Creates a new FeatureId representing the “base” feature for a package.
Returns the package ID.
Returns the name of the feature, or None if this is the “base” feature for this package.
Trait Implementations
The Display impl prints out {package id}/feature, or {package id}/[base].
Examples
use guppy::PackageId;
use guppy::graph::feature::FeatureId;
let package_id = PackageId::new("region 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)");
assert_eq!(
format!("{}", FeatureId::new(&package_id, "foo")),
"region 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)/foo"
);
assert_eq!(
format!("{}", FeatureId::base(&package_id)),
"region 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)/[base]"
);This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
Auto Trait Implementations
impl<'g> RefUnwindSafe for FeatureId<'g>
impl<'g> UnwindSafe for FeatureId<'g>
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key and return true if they are equal.