pub enum CfgAtom {
Flag(SmolStr),
KeyValue {
key: SmolStr,
value: SmolStr,
},
}
Expand description
A simple configuration value passed in from the outside.
Variants
Flag(SmolStr)
eg. #[cfg(test)]
KeyValue
eg. #[cfg(target_os = "linux")]
Note that a key can have multiple values that are all considered “active” at the same time.
For example, #[cfg(target_feature = "sse")]
and #[cfg(target_feature = "sse2")]
.
Implementations
sourceimpl CfgAtom
impl CfgAtom
sourcepub fn is_target_defined(&self) -> bool
pub fn is_target_defined(&self) -> bool
Returns true
when the atom comes from the target specification.
If this returns true
, then changing this atom requires changing the compilation target. If
it returns false
, the atom might come from a build script or the build system.
Trait Implementations
sourceimpl Ord for CfgAtom
impl Ord for CfgAtom
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<CfgAtom> for CfgAtom
impl PartialOrd<CfgAtom> for CfgAtom
sourcefn partial_cmp(&self, other: &CfgAtom) -> Option<Ordering>
fn partial_cmp(&self, other: &CfgAtom) -> Option<Ordering>
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 moreimpl Eq for CfgAtom
impl StructuralEq for CfgAtom
impl StructuralPartialEq for CfgAtom
Auto Trait Implementations
impl RefUnwindSafe for CfgAtom
impl Send for CfgAtom
impl Sync for CfgAtom
impl Unpin for CfgAtom
impl UnwindSafe for CfgAtom
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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