Skip to main content

MaskInteroperable

Trait MaskInteroperable 

Source
pub trait MaskInteroperable<A, B>: GenericVector<Mask: CastMask<A::Mask> + CastMask<B::Mask>>
where A: GenericVector<Lanes = Self::Lanes, Mask: CastMask<Self::Mask> + CastMask<B::Mask>>, B: GenericVector<Lanes = Self::Lanes, Mask: CastMask<Self::Mask> + CastMask<A::Mask>>,
{ }
Expand description

Three vector types (Self, A, B) whose masks can all be freely cast to one another.

All three must share the same Lanes count, and each one’s Mask must implement CastMask into the other two. This is a convenience bound for generic code that selects or blends across vectors of different element types but identical width - e.g. using a mask produced from a float comparison to select lanes of an integer vector.

It is blanket-implemented for every triple of types satisfying the cast requirements, so it never needs to be implemented manually.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<T, A, B> MaskInteroperable<A, B> for T
where T: GenericVector<Mask: CastMask<A::Mask> + CastMask<B::Mask>>, A: GenericVector<Lanes = T::Lanes, Mask: CastMask<T::Mask> + CastMask<B::Mask>>, B: GenericVector<Lanes = T::Lanes, Mask: CastMask<T::Mask> + CastMask<A::Mask>>,