Enum guppy::graph::feature::FeatureLabel
source · pub enum FeatureLabel<'g> {
Base,
Named(&'g str),
OptionalDependency(&'g str),
}
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 for FeatureLabel<'g>
impl<'g> PartialEq for FeatureLabel<'g>
source§impl<'g> PartialOrd for FeatureLabel<'g>
impl<'g> PartialOrd for FeatureLabel<'g>
impl<'g> Copy for FeatureLabel<'g>
impl<'g> Eq for FeatureLabel<'g>
impl<'g> StructuralPartialEq for FeatureLabel<'g>
Auto Trait Implementations§
impl<'g> Freeze for FeatureLabel<'g>
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<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more