pub enum FeatureRef {
Feature {
name: String,
},
Dependency {
name: String,
},
DependencyFeature {
dependency: String,
feature: String,
weak: bool,
},
Unknown {
raw: String,
},
}Expand description
A typed reference inside a feature definition.
Variants§
Feature
Reference to another local Cargo feature.
Dependency
Reference to an optional dependency using dep:name.
DependencyFeature
Reference to a dependency feature such as tokio/rt.
Fields
Unknown
Reference syntax that could not be classified.
Implementations§
Source§impl FeatureRef
impl FeatureRef
Sourcepub fn local_feature_name(&self) -> Option<&str>
pub fn local_feature_name(&self) -> Option<&str>
Returns the local feature name when this is a local feature reference.
Sourcepub fn dependency_name(&self) -> Option<&str>
pub fn dependency_name(&self) -> Option<&str>
Returns the dependency key for dependency-based references.
Trait Implementations§
Source§impl Clone for FeatureRef
impl Clone for FeatureRef
Source§fn clone(&self) -> FeatureRef
fn clone(&self) -> FeatureRef
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FeatureRef
impl Debug for FeatureRef
Source§impl Display for FeatureRef
impl Display for FeatureRef
Source§impl Ord for FeatureRef
impl Ord for FeatureRef
Source§fn cmp(&self, other: &FeatureRef) -> Ordering
fn cmp(&self, other: &FeatureRef) -> Ordering
1.21.0 (const: unstable) · 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 PartialEq for FeatureRef
impl PartialEq for FeatureRef
Source§fn eq(&self, other: &FeatureRef) -> bool
fn eq(&self, other: &FeatureRef) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for FeatureRef
impl PartialOrd for FeatureRef
Source§impl Serialize for FeatureRef
impl Serialize for FeatureRef
impl Eq for FeatureRef
impl StructuralPartialEq for FeatureRef
Auto Trait Implementations§
impl Freeze for FeatureRef
impl RefUnwindSafe for FeatureRef
impl Send for FeatureRef
impl Sync for FeatureRef
impl Unpin for FeatureRef
impl UnsafeUnpin for FeatureRef
impl UnwindSafe for FeatureRef
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§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.