pub enum FeatureEntry {
Local(String),
OptionalDep(String),
DepFeature {
dep: String,
feature: String,
},
}Expand description
Typed view of a single right-hand-side entry in a [features]
list (feature_name, dep:dependency_name, or
dependency_name/feature_name).
cabin-core parses the form lazily — the on-disk shape stays
the original string — so older readers are unaffected. The
feature resolver consumes the typed view to decide which
effects an entry has.
Variants§
Local(String)
Enables another local feature on the same package.
OptionalDep(String)
Enables an optional Cabin package dependency declared by
this package. Spelled dep:<name> in the manifest.
DepFeature
Requests feature on dep. If dep is optional, this
also enables it. Spelled <dep>/<feature> in the
manifest.
Implementations§
Source§impl FeatureEntry
impl FeatureEntry
Sourcepub fn parse(input: &str) -> Result<Self, InvalidFeatureEntryKind>
pub fn parse(input: &str) -> Result<Self, InvalidFeatureEntryKind>
Parse a single [features] value into a typed entry.
§Errors
Returns InvalidFeatureEntryKind::Empty for an empty input,
InvalidFeatureEntryKind::EmptyDepName for a bare dep:,
InvalidFeatureEntryKind::MultiplePathSeparators for more than one
/, InvalidFeatureEntryKind::EmptyDepOrFeature when either side of
<dep>/<feature> is empty, and
InvalidFeatureEntryKind::UnsupportedCharacter for a name containing a
character outside the allowed identifier set.
Trait Implementations§
Source§impl Clone for FeatureEntry
impl Clone for FeatureEntry
Source§fn clone(&self) -> FeatureEntry
fn clone(&self) -> FeatureEntry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FeatureEntry
impl Debug for FeatureEntry
Source§impl PartialEq for FeatureEntry
impl PartialEq for FeatureEntry
Source§fn eq(&self, other: &FeatureEntry) -> bool
fn eq(&self, other: &FeatureEntry) -> bool
self and other values to be equal, and is used by ==.impl Eq for FeatureEntry
impl StructuralPartialEq for FeatureEntry
Auto Trait Implementations§
impl Freeze for FeatureEntry
impl RefUnwindSafe for FeatureEntry
impl Send for FeatureEntry
impl Sync for FeatureEntry
impl Unpin for FeatureEntry
impl UnsafeUnpin for FeatureEntry
impl UnwindSafe for FeatureEntry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
key and return true if they are equal.