bitflags_derive/
lib.rs

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
38
39
40
41
42
43
44
45
46
/*!
Custom derive attributes for types generated by [`bitflags`](https://docs.rs/bitflags).

## Usage

Add `bitflags-derive` to your `Cargo.toml` alongside `bitflags`:

```toml
[dependencies.bitflags-derive]
version = "0.0.1"

[dependencies.bitflags]
version = "2"
```

Inside the [`bitflags!` macro](https://docs.rs/bitflags/latest/bitflags/macro.bitflags.html), add a `#[derive]` attribute with any traits from `bitflags-derive` that you'd like to support:

```rust
#[macro_use]
extern crate bitflags;

#[macro_use]
extern crate bitflags_derive;

bitflags! {
    #[derive(FlagsDebug)]
    struct Flags: u8 {
        const A = 1;
        const B = 1 << 1;
        const C = 1 << 2;
    }
}
# fn main() {}
```
*/

#![deny(missing_docs)]

#[doc(inline)]
pub use bitflags_derive_macros::*;

#[doc(hidden)]
pub mod __private {
    pub use bitflags;
    pub use core;
}