Flag

Trait 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 Constants§

Source

const ITEMS: &'static [Self]

A list of all flag variants in the enum

Required Associated Types§

Source

type Primitive: Primitive

Associated primitive numeric type

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Flag for Test

Source§

const ITEMS: &'static [Self]

Source§

type Primitive = u8