Skip to main content

Mask

Struct Mask 

Source
pub struct Mask<T: Scalar, S: Backend<T>> { /* private fields */ }
Expand description

A varying boolean mask companion to Varying.

Implementations§

Source§

impl<T: Scalar, S: Backend<T>> Mask<T, S>

Source

pub fn raw(self) -> S::Mask

The raw backend mask.

Source

pub fn any(self) -> bool

True if any lane is set.

Source

pub fn all(self) -> bool

True if every lane is set.

Source

pub fn to_bitmask(self) -> u32

The set lanes packed into the low lanes bits of a u32: bit i set iff lane i is set; bits at and above lanes() are zero. count_ones() gives an exact set-lane count and trailing_zeros() the first set lane.

Trait Implementations§

Source§

impl<T: Scalar, S: Backend<T>> BitAnd for Mask<T, S>

Source§

type Output = Mask<T, S>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: Self) -> Self

Performs the & operation. Read more
Source§

impl<T: Scalar, S: Backend<T>> BitOr for Mask<T, S>

Source§

type Output = Mask<T, S>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Self) -> Self

Performs the | operation. Read more
Source§

impl<T: Clone + Scalar, S: Clone + Backend<T>> Clone for Mask<T, S>
where S::Mask: Clone,

Source§

fn clone(&self) -> Mask<T, S>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Copy + Scalar, S: Copy + Backend<T>> Copy for Mask<T, S>
where S::Mask: Copy,

Source§

impl<T: Scalar, S: Backend<T>> Not for Mask<T, S>

Source§

type Output = Mask<T, S>

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self

Performs the unary ! operation. Read more

Auto Trait Implementations§

§

impl<T, S> Freeze for Mask<T, S>
where S: Freeze, <S as Backend<T>>::Mask: Freeze,

§

impl<T, S> RefUnwindSafe for Mask<T, S>

§

impl<T, S> Send for Mask<T, S>
where S: Send, <S as Backend<T>>::Mask: Send,

§

impl<T, S> Sync for Mask<T, S>
where S: Sync, <S as Backend<T>>::Mask: Sync,

§

impl<T, S> Unpin for Mask<T, S>
where S: Unpin, <S as Backend<T>>::Mask: Unpin, T: Unpin,

§

impl<T, S> UnsafeUnpin for Mask<T, S>
where S: UnsafeUnpin, <S as Backend<T>>::Mask: UnsafeUnpin,

§

impl<T, S> UnwindSafe for Mask<T, S>
where S: UnwindSafe, <S as Backend<T>>::Mask: UnwindSafe, T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.