Macro flags_macro::flags

source ·
macro_rules! flags {
    ( $($ns:ident::)* {$($items:tt)*} ) => { ... };
}
Expand description

Emits an expression of type <E as DefaultSet>::Set given zero or more values of type E defined as associated constants or enumerate items of E.

Examples

See the module-level documentation.

Syntax

flags![path::ty::{Item1 | ... | ItemN}]
flags![path::ty::{Item1, ..., ItemN}]

Item1ItemN are identifiers. Conceptually, these expressions are expanded into:

<path::ty as DefaultSet>::Set::from_iter([
    path::ty::Item1, ..., path::ty::ItemN
].iter().cloned())

Usually, this is equivalent to:

path::ty::Item1 | ... | path::ty::ItemN

Invalid usages

The path prefix (denoted as path::ty:: in Section “Syntax”) must not be empty.