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
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>
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 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 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<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