# Trait SimdElement

Source

    pub unsafe trait SimdElement: Sealed + Copy {
        type Mask: MaskElement;
    }

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

Marker trait for types that may be used as SIMD vector elements.

## §Safety

This trait, when implemented, asserts the compiler can monomorphize `#[repr(simd)]` structs with the marked type as an element. Strictly, it is valid to impl if the vector will not be miscompiled. Practically, it is user-unfriendly to impl it if the vector won’t compile, even when no soundness guarantees are broken by allowing the user to try.

## Required Associated Types§

Source

#### type Mask: MaskElement

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

The mask element type corresponding to this element type.

## 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 SimdElement for f32

Source§

#### type Mask = i32

Source§

### impl SimdElement for f64

Source§

#### type Mask = i64

Source§

### impl SimdElement for i8

Source§

#### type Mask = i8

Source§

### impl SimdElement for i16

Source§

#### type Mask = i16

Source§

### impl SimdElement for i32

Source§

#### type Mask = i32

Source§

### impl SimdElement for i64

Source§

#### type Mask = i64

Source§

### impl SimdElement for isize

Source§

#### type Mask = isize

Source§

### impl SimdElement for u8

Source§

#### type Mask = i8

Source§

### impl SimdElement for u16

Source§

#### type Mask = i16

Source§

### impl SimdElement for u32

Source§

#### type Mask = i32

Source§

### impl SimdElement for u64

Source§

#### type Mask = i64

Source§

### impl SimdElement for usize

Source§

#### type Mask = isize

Source§

### impl<T> SimdElement for *const T
where T: Pointee<Metadata = ()>,

Source§

#### type Mask = isize

Source§

### impl<T> SimdElement for *mut T
where T: Pointee<Metadata = ()>,

Source§

#### type Mask = isize