Trait sawp_flags::Flag

source ·
pub trait Flag: Copy + Clone + Debug + Display + 'static {
    type Primitive: Primitive;

    const ITEMS: &'static [Self];

    // Required methods
    fn bits(self) -> Self::Primitive;
    fn none() -> Flags<Self>;
    fn all() -> Flags<Self>;
}
Expand description

A trait implemented by all flag enums.

Required Associated Types§

source

type Primitive: Primitive

Associated primitive numeric type

Required Associated Constants§

source

const ITEMS: &'static [Self]

A list of all flag variants in the enum

Required Methods§

source

fn bits(self) -> Self::Primitive

Numeric representation of the variant

source

fn none() -> Flags<Self>

Flag value when no variants are set

source

fn all() -> Flags<Self>

Flag value when all variants are set

Implementors§

source§

impl Flag for Test

§

type Primitive = u8

source§

const ITEMS: &'static [Self] = _