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
sourceimpl<'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
sourceimpl<'g> Clone for FeatureLabel<'g>
impl<'g> Clone for FeatureLabel<'g>
sourcefn clone(&self) -> FeatureLabel<'g>
fn clone(&self) -> FeatureLabel<'g>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'g> Debug for FeatureLabel<'g>
impl<'g> Debug for FeatureLabel<'g>
sourceimpl<'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");
sourceimpl<'g> Hash for FeatureLabel<'g>
impl<'g> Hash for FeatureLabel<'g>
sourceimpl<'g> Ord for FeatureLabel<'g>
impl<'g> Ord for FeatureLabel<'g>
sourceimpl<'g> PartialEq<FeatureLabel<'g>> for FeatureLabel<'g>
impl<'g> PartialEq<FeatureLabel<'g>> for FeatureLabel<'g>
sourcefn eq(&self, other: &FeatureLabel<'g>) -> bool
fn eq(&self, other: &FeatureLabel<'g>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &FeatureLabel<'g>) -> bool
fn ne(&self, other: &FeatureLabel<'g>) -> bool
This method tests for !=
.
sourceimpl<'g> PartialOrd<FeatureLabel<'g>> for FeatureLabel<'g>
impl<'g> PartialOrd<FeatureLabel<'g>> for FeatureLabel<'g>
sourcefn partial_cmp(&self, other: &FeatureLabel<'g>) -> Option<Ordering>
fn partial_cmp(&self, other: &FeatureLabel<'g>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
impl<'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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more