FlagPrimitive

Trait FlagPrimitive 

Source
pub trait FlagPrimitive:
    Sized
    + Not<Output = Self>
    + BitAnd<Self, Output = Self>
    + BitOr<Self, Output = Self>
    + BitAnd<Self, Output = Self>
    + BitXor<Self, Output = Self>
    + Shl<Self, Output = Self>
    + Shr<Self, Output = Self>
    + Clone
    + Copy
    + Debug
    + Eq {
    const ZERO: Self;
    const ONE: Self;
}
Expand description

A trait to define which primitives can be used as a primitive for a flags. Restricted to unsigned types for ease of use.

Required Associated Constants§

Source

const ZERO: Self

0 in this type

Source

const ONE: Self

1 in this type

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.

Implementations on Foreign Types§

Source§

impl FlagPrimitive for u8

Source§

const ZERO: Self = 0u8

Source§

const ONE: Self = 1u8

Source§

impl FlagPrimitive for u16

Source§

const ZERO: Self = 0u16

Source§

const ONE: Self = 1u16

Source§

impl FlagPrimitive for u32

Source§

const ZERO: Self = 0u32

Source§

const ONE: Self = 1u32

Source§

impl FlagPrimitive for u64

Source§

const ZERO: Self = 0u64

Source§

const ONE: Self = 1u64

Source§

impl FlagPrimitive for u128

Source§

const ZERO: Self = 0u128

Source§

const ONE: Self = 1u128

Source§

impl FlagPrimitive for usize

Source§

const ZERO: Self = 0usize

Source§

const ONE: Self = 1usize

Implementors§