Skip to main content

Mask

Trait Mask 

Source
pub trait Mask:
    Copy
    + PartialEq
    + Debug {
    // Required methods
    fn none() -> Self;
    fn first(n: usize) -> Self;
    fn has(self, lane: usize) -> bool;
    fn insert(&mut self, lane: usize);
    fn remove(&mut self, lane: usize);
    fn and(self, other: Self) -> Self;
    fn or(self, other: Self) -> Self;
    fn minus(self, other: Self) -> Self;
    fn is_empty(self) -> bool;
}
Expand description

A set of the lanes of a run.

Required Methods§

Source

fn none() -> Self

The empty set.

Source

fn first(n: usize) -> Self

Lanes 0..n.

Source

fn has(self, lane: usize) -> bool

Whether lane is in the set.

Source

fn insert(&mut self, lane: usize)

Add lane; a lane past the width of the set changes nothing.

Source

fn remove(&mut self, lane: usize)

Remove lane; a lane past the width of the set changes nothing.

Source

fn and(self, other: Self) -> Self

The lanes in both sets.

Source

fn or(self, other: Self) -> Self

The lanes in either set.

Source

fn minus(self, other: Self) -> Self

The lanes of self that are not in other.

Source

fn is_empty(self) -> bool

Whether the set has no lane.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Mask for u8

Source§

fn none() -> Self

Source§

fn first(n: usize) -> Self

Source§

fn has(self, lane: usize) -> bool

Source§

fn insert(&mut self, lane: usize)

Source§

fn remove(&mut self, lane: usize)

Source§

fn and(self, other: Self) -> Self

Source§

fn or(self, other: Self) -> Self

Source§

fn minus(self, other: Self) -> Self

Source§

fn is_empty(self) -> bool

Source§

impl Mask for u16

Source§

fn none() -> Self

Source§

fn first(n: usize) -> Self

Source§

fn has(self, lane: usize) -> bool

Source§

fn insert(&mut self, lane: usize)

Source§

fn remove(&mut self, lane: usize)

Source§

fn and(self, other: Self) -> Self

Source§

fn or(self, other: Self) -> Self

Source§

fn minus(self, other: Self) -> Self

Source§

fn is_empty(self) -> bool

Source§

impl Mask for u32

Source§

fn none() -> Self

Source§

fn first(n: usize) -> Self

Source§

fn has(self, lane: usize) -> bool

Source§

fn insert(&mut self, lane: usize)

Source§

fn remove(&mut self, lane: usize)

Source§

fn and(self, other: Self) -> Self

Source§

fn or(self, other: Self) -> Self

Source§

fn minus(self, other: Self) -> Self

Source§

fn is_empty(self) -> bool

Implementors§