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 FeatureLabel<'_>
impl FeatureLabel<'_>
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 duplicate 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 Display for FeatureLabel<'_>
The Display impl for FeatureLabel prints out:
impl Display for FeatureLabel<'_>
The Display impl for FeatureLabel prints out:
[base]for base labels.feature-namefor optional dependencies.dep:dep-namefor 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,
§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
Compare self to
key and return true if they are equal.§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
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