Trait slipstream::mask::Mask

source ·
pub trait Mask: Copy + Eq + Send + Sync + Sealed + Not + BitAnd + BitAndAssign + BitOr + BitOrAssign + BitXor + BitXorAssign + 'static {
    const TRUE: Self;
    const FALSE: Self;

    // Provided methods
    fn bool(self) -> bool { ... }
    fn from_bool(v: bool) -> Self { ... }
}
Expand description

The trait implemented by all the mask types.

Note that this trait is not implementable by downstream crates, as code in the crate assumes (and relies for safety on the assumption) that the type can ever hold only the two values.

See the module documentation.

Required Associated Constants§

source

const TRUE: Self

A constant specifying the true value of the type.

For bool, this is true. For the others, this means all bits set to 1 ‒ eg. 256 for `m8.

source

const FALSE: Self

The false value of the type.

For bool, this is false. For the others, this means 0 (all bits set to 0).

Provided Methods§

source

fn bool(self) -> bool

Converts the type to bool.

source

fn from_bool(v: bool) -> Self

Converts the type from bool.

Implementations on Foreign Types§

source§

impl Mask for bool

source§

const TRUE: Self = true

source§

const FALSE: Self = false

Implementors§

source§

impl Mask for m8

source§

const TRUE: Self = _

source§

const FALSE: Self = _

source§

impl Mask for m16

source§

const TRUE: Self = _

source§

const FALSE: Self = _

source§

impl Mask for m32

source§

const TRUE: Self = _

source§

const FALSE: Self = _

source§

impl Mask for m64

source§

const TRUE: Self = _

source§

const FALSE: Self = _

source§

impl Mask for m128

source§

const TRUE: Self = _

source§

const FALSE: Self = _

source§

impl Mask for msize

source§

const TRUE: Self = _

source§

const FALSE: Self = _