Macro async_proto::bitflags

source ·
bitflags!() { /* proc-macro */ }
Expand description

Implements Protocol for a type defined using the bitflags::bitflags macro.

The type will be read via from_bits_truncate, dropping any bits that do not correspond to flags.

§Usage

bitflags::bitflags! {
    struct Flags: u32 {
        const A = 0b00000001;
        const B = 0b00000010;
        const C = 0b00000100;
        const ABC = Self::A.bits | Self::B.bits | Self::C.bits;
    }
}

async_proto::bitflags!(Flags: u32);