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
)Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.