1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//! An example of defining an external flags definition using the [`bitflag`] macro.
use bitflag;
// If you're generating flags types from an external source, such as a C API, you can use the
// `#[non_exhaustive]` attribute to communicate to the bitflags macro that there may be more valid
// flags then the known flags.
//
// Without extra configuration, it defaults to `!0` (all bits set) as a mask of all bits the
/// external source may ever set, i.e. all bits are considered as possible values. But a value can
/// be defined using the `#[reserved_bits = <value>]` helper attribute.