Module cfg

Source
Expand description

Provides helpful configuration macros, allowing detection of platform features such as alloc or std without explicit features.

Macrosยง

alloc
Indicates the alloc crate is available and can be used.
arc
Indicates that this target has access to a native implementation of Arc.
critical_section
Indicates critical-section is available.
define_alias
Defines an alias for a particular configuration. This has two advantages over directly using #[cfg(...)]:
disabled
Macro which represents a disabled compilation condition.
enabled
Macro which represents an enabled compilation condition.
panic_abort
Indicates that a panic will lead to an abort, and cannot be caught.
panic_unwind
Indicates that a panic will be unwound, and can be potentially caught.
std
Indicates the std crate is available and can be used.
switch
Provides a match-like expression similar to cfg_if and based on the experimental cfg_match. The name switch is used to avoid conflict with the match keyword. Arms are evaluated top to bottom, and an optional wildcard arm can be provided if no match can be made.
web
Indicates that this target has access to browser APIs.