Enum rustdoc::clean::cfg::Cfg [−][src]
pub(crate) enum Cfg {
True,
False,
Cfg(Symbol, Option<Symbol>),
Not(Box<Cfg>),
Any(Vec<Cfg>),
All(Vec<Cfg>),
}
Variants
Accepts all configurations.
Denies all configurations.
A generic configuration option, e.g., test
or target_os = "linux"
.
Negates a configuration requirement, i.e., not(x)
.
Union of a list of configuration requirements, i.e., any(...)
.
Intersection of a list of configuration requirements, i.e., all(...)
.
Implementations
Parses a NestedMetaItem
into a Cfg
.
Parses a MetaItem
into a Cfg
.
The MetaItem
should be the content of the #[cfg(...)]
, e.g., unix
or
target_os = "redox"
.
If the content is not properly formatted, it will return an error indicating what and where the error is.
Checks whether the given configuration can be matched in the current session.
Equivalent to attr::cfg_matches
.
Renders the configuration for human display, as a short HTML description.
Renders the configuration for long display, as a long HTML description.
Renders the configuration for long display, as a long plain text description.
Attempt to simplify this cfg by assuming that assume
is already known to be true, will
return None
if simplification managed to completely eliminate any requirements from this
Cfg
.
See tests::test_simplify_with
for examples.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Cfg
impl UnwindSafe for Cfg
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Layout
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 32 bytes
Size for each variant:
True
: 0 bytesFalse
: 0 bytesCfg
: 8 bytesNot
: 12 bytesAny
: 28 bytesAll
: 28 bytes