Trait Sealed

Source
pub trait Sealed {
    type Unsigned: SimdElement;

    const TRUE: Self;
    const FALSE: Self;

    // Required methods
    fn valid<const N: usize>(values: Simd<Self, N>) -> bool
       where LaneCount<N>: SupportedLaneCount,
             Self: SimdElement;
    fn eq(self, other: Self) -> bool;
    fn to_usize(self) -> usize;
    fn max_unsigned() -> u64;
}
🔬This is a nightly-only experimental API. (portable_simd #86656)
Expand description

Not only does this seal the MaskElement trait, but these functions prevent other traits from bleeding into the parent bounds.

For example, eq could be provided by requiring MaskElement: PartialEq, but that would prevent us from ever removing that bound, or from implementing MaskElement on non-PartialEq types in the future.

Required Associated Constants§

Source

const TRUE: Self

🔬This is a nightly-only experimental API. (portable_simd #86656)
Source

const FALSE: Self

🔬This is a nightly-only experimental API. (portable_simd #86656)

Required Associated Types§

Source

type Unsigned: SimdElement

🔬This is a nightly-only experimental API. (portable_simd #86656)

Required Methods§

Source

fn valid<const N: usize>(values: Simd<Self, N>) -> bool

🔬This is a nightly-only experimental API. (portable_simd #86656)
Source

fn eq(self, other: Self) -> bool

🔬This is a nightly-only experimental API. (portable_simd #86656)
Source

fn to_usize(self) -> usize

🔬This is a nightly-only experimental API. (portable_simd #86656)
Source

fn max_unsigned() -> u64

🔬This is a nightly-only experimental API. (portable_simd #86656)

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§

Source§

impl Sealed for i8

Source§

const TRUE: Self = -1i8

Source§

const FALSE: Self = 0i8

Source§

type Unsigned = u8

Source§

impl Sealed for i16

Source§

const TRUE: Self = -1i16

Source§

const FALSE: Self = 0i16

Source§

type Unsigned = u16

Source§

impl Sealed for i32

Source§

const TRUE: Self = -1i32

Source§

const FALSE: Self = 0i32

Source§

type Unsigned = u32

Source§

impl Sealed for i64

Source§

const TRUE: Self = -1i64

Source§

const FALSE: Self = 0i64

Source§

type Unsigned = u64

Source§

impl Sealed for isize

Source§

const TRUE: Self = -1isize

Source§

const FALSE: Self = 0isize

Source§

type Unsigned = usize