Skip to main content

VectorMask

Trait VectorMask 

Source
pub trait VectorMask<T, const N: usize>
where T: Scalar,
{ type Mask; // Required methods fn eq(&self, other: &Self) -> Self::Mask; fn ne(&self, other: &Self) -> Self::Mask; fn gt(&self, other: &Self) -> Self::Mask; fn ge(&self, other: &Self) -> Self::Mask; fn lt(&self, other: &Self) -> Self::Mask; fn le(&self, other: &Self) -> Self::Mask; fn select(&self, other: &Self, mask: Self::Mask) -> Self; fn all(mask: &Self::Mask) -> bool; }
Expand description

Vector comparison and masking operations.

Produces a bitmask (or SIMD mask) from lane-wise comparisons, and allows selecting between two vectors based on a mask.

Required Associated Types§

Source

type Mask

The mask type (e.g. i32 bitmask or SIMD mask register).

Required Methods§

Source

fn eq(&self, other: &Self) -> Self::Mask

Lane-wise equality comparison.

Source

fn ne(&self, other: &Self) -> Self::Mask

Lane-wise inequality comparison.

Source

fn gt(&self, other: &Self) -> Self::Mask

Lane-wise greater-than comparison.

Source

fn ge(&self, other: &Self) -> Self::Mask

Lane-wise greater-or-equal comparison.

Source

fn lt(&self, other: &Self) -> Self::Mask

Lane-wise less-than comparison.

Source

fn le(&self, other: &Self) -> Self::Mask

Lane-wise less-or-equal comparison.

Source

fn select(&self, other: &Self, mask: Self::Mask) -> Self

Select lanes from self (where mask is truthy) or other.

Source

fn all(mask: &Self::Mask) -> bool

Returns true if all mask lanes 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§