Skip to main content

flags

Attribute Macro flags 

Source
#[flags]
Expand description

Expands an enum into a compact bitflag type.

The #[flag] attributes on variants are helper markers consumed by this attribute macro. They are intentionally not exported as standalone macros, so using #[flag] without #[flags] fails at compile time.

#[flags] optionally accepts an explicit backing integer type, e.g. #[flags(u32)]. Without an argument the smallest type that fits every flag value is chosen automatically, matching prior behavior.