Enum rustdoc::clean::cfg::Cfg[][src]

pub(crate) enum Cfg {
    True,
    False,
    Cfg(SymbolOption<Symbol>),
    Not(Box<Cfg>),
    Any(Vec<Cfg>),
    All(Vec<Cfg>),
}

Variants

True

Accepts all configurations.

False

Denies all configurations.

Cfg(SymbolOption<Symbol>)

A generic configuration option, e.g., test or target_os = "linux".

Tuple Fields of Cfg

0: Symbol1: Option<Symbol>
Not(Box<Cfg>)

Negates a configuration requirement, i.e., not(x).

Tuple Fields of Not

0: Box<Cfg>
Any(Vec<Cfg>)

Union of a list of configuration requirements, i.e., any(...).

Tuple Fields of Any

0: Vec<Cfg>
All(Vec<Cfg>)

Intersection of a list of configuration requirements, i.e., all(...).

Tuple Fields of All

0: Vec<Cfg>

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.

Whether the configuration consists of just Cfg or Not.

Whether the configuration consists of just Cfg, Not or All.

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

The resulting type after applying the & operator.

Performs the & operation. Read more

Performs the &= operation. Read more

The resulting type after applying the | operator.

Performs the | operation. Read more

Performs the |= operation. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

The resulting type after applying the ! operator.

Performs the unary ! operation. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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: