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

Not(Box<Cfg>)

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

Any(Vec<Cfg>)

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

All(Vec<Cfg>)

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.

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 !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

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

Returns the argument unchanged.

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

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
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:

  • True: 0 bytes
  • False: 0 bytes
  • Cfg: 8 bytes
  • Not: 12 bytes
  • Any: 28 bytes
  • All: 28 bytes