Enum guppy::graph::feature::FeatureLabel
source · Expand description
A unique identifier for a feature within a specific package. Forms part of a FeatureId
.
Variants§
Base
The “base” feature. Every package has one such feature.
Named(&'g str)
This is a named feature in the [features]
section, or an implicit feature that corresponds to
an optional dependency.
For versions of Cargo prior to 1.60, optional dependencies always create implicit features by the same name. For versions 1.60 and greater, optional dependencies may create implicit features if the dependency doesn’t exist with the name “dep” in it.
OptionalDependency(&'g str)
This is an optional dependency.
Implementations§
source§impl<'g> FeatureLabel<'g>
impl<'g> FeatureLabel<'g>
sourcepub fn kind(self) -> FeatureKind
pub fn kind(self) -> FeatureKind
Returns the kind of feature this is.
The kind of a feature is simply the enum variant without any associated data.
Trait Implementations§
source§impl<'g> Clone for FeatureLabel<'g>
impl<'g> Clone for FeatureLabel<'g>
source§fn clone(&self) -> FeatureLabel<'g>
fn clone(&self) -> FeatureLabel<'g>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'g> Debug for FeatureLabel<'g>
impl<'g> Debug for FeatureLabel<'g>
source§impl<'g> Display for FeatureLabel<'g>
impl<'g> Display for FeatureLabel<'g>
The Display
impl for FeatureLabel
prints out:
[base]
for base labels.feature-name
for optional dependencies.dep:dep-name
for named features.
Examples
use guppy::graph::feature::FeatureLabel;
assert_eq!(format!("{}", FeatureLabel::Base), "[base]");
assert_eq!(format!("{}", FeatureLabel::Named("foo")), "foo");
assert_eq!(format!("{}", FeatureLabel::OptionalDependency("bar")), "dep:bar");
source§impl<'g> Hash for FeatureLabel<'g>
impl<'g> Hash for FeatureLabel<'g>
source§impl<'g> Ord for FeatureLabel<'g>
impl<'g> Ord for FeatureLabel<'g>
source§fn cmp(&self, other: &FeatureLabel<'g>) -> Ordering
fn cmp(&self, other: &FeatureLabel<'g>) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<'g> PartialEq<FeatureLabel<'g>> for FeatureLabel<'g>
impl<'g> PartialEq<FeatureLabel<'g>> for FeatureLabel<'g>
source§fn eq(&self, other: &FeatureLabel<'g>) -> bool
fn eq(&self, other: &FeatureLabel<'g>) -> bool
source§impl<'g> PartialOrd<FeatureLabel<'g>> for FeatureLabel<'g>
impl<'g> PartialOrd<FeatureLabel<'g>> for FeatureLabel<'g>
source§fn partial_cmp(&self, other: &FeatureLabel<'g>) -> Option<Ordering>
fn partial_cmp(&self, other: &FeatureLabel<'g>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<'g> Copy for FeatureLabel<'g>
impl<'g> Eq for FeatureLabel<'g>
impl<'g> StructuralEq for FeatureLabel<'g>
impl<'g> StructuralPartialEq for FeatureLabel<'g>
Auto Trait Implementations§
impl<'g> RefUnwindSafe for FeatureLabel<'g>
impl<'g> Send for FeatureLabel<'g>
impl<'g> Sync for FeatureLabel<'g>
impl<'g> Unpin for FeatureLabel<'g>
impl<'g> UnwindSafe for FeatureLabel<'g>
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.