Skip to main content

ExtractToken

Trait ExtractToken 

Source
pub trait ExtractToken {
    type S: Simd;

    // Required method
    fn token(&self) -> Self::S;
}
Expand description

A value that carries a SIMD token.

Implemented by all SIMD tokens, vectors, and masks, and by references to these types. User-defined wrappers can implement this trait by returning the token of a contained value.

The #[simd] attribute extracts a token from its first non-receiver parameter using this trait.

use fearless_simd::{ExtractToken, Simd, f32x4};

// Four consecutive audio samples, processed together.
struct AudioSamples<S: Simd>(f32x4<S>);

impl<S: Simd> ExtractToken for AudioSamples<S> {
    type S = S;

    #[inline]
    fn token(&self) -> S {
        self.0.token()
    }
}

Required Associated Types§

Source

type S: Simd

The SIMD implementation associated with this value.

Required Methods§

Source

fn token(&self) -> Self::S

Get the SIMD token associated with this value.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<T: ExtractToken + ?Sized> ExtractToken for &T

Source§

type S = <T as ExtractToken>::S

Source§

fn token(&self) -> Self::S

Source§

impl<T: ExtractToken + ?Sized> ExtractToken for &mut T

Source§

type S = <T as ExtractToken>::S

Source§

fn token(&self) -> Self::S

Implementors§

Source§

impl ExtractToken for Avx2

Available on x86 or x86-64 only.
Source§

impl ExtractToken for Avx512

Available on x86 or x86-64 only.
Source§

impl ExtractToken for Fallback

Available on crate feature force_support_fallback or neither AArch64 and target feature neon, nor target feature fxsr and target feature sse2 and (x86 or x86-64), nor WebAssembly and target feature simd128 only.
Source§

impl ExtractToken for Sse2

Available on x86 or x86-64 only.
Source§

impl ExtractToken for Sse4_2

Available on x86 or x86-64 only.
Source§

impl<S: Simd> ExtractToken for f32x4<S>

Source§

type S = S

Source§

impl<S: Simd> ExtractToken for f32x8<S>

Source§

type S = S

Source§

impl<S: Simd> ExtractToken for f32x16<S>

Source§

type S = S

Source§

impl<S: Simd> ExtractToken for f64x2<S>

Source§

type S = S

Source§

impl<S: Simd> ExtractToken for f64x4<S>

Source§

type S = S

Source§

impl<S: Simd> ExtractToken for f64x8<S>

Source§

type S = S

Source§

impl<S: Simd> ExtractToken for i8x16<S>

Source§

type S = S

Source§

impl<S: Simd> ExtractToken for i8x32<S>

Source§

type S = S

Source§

impl<S: Simd> ExtractToken for i8x64<S>

Source§

type S = S

Source§

impl<S: Simd> ExtractToken for i16x8<S>

Source§

type S = S

Source§

impl<S: Simd> ExtractToken for i16x16<S>

Source§

type S = S

Source§

impl<S: Simd> ExtractToken for i16x32<S>

Source§

type S = S

Source§

impl<S: Simd> ExtractToken for i32x4<S>

Source§

type S = S

Source§

impl<S: Simd> ExtractToken for i32x8<S>

Source§

type S = S

Source§

impl<S: Simd> ExtractToken for i32x16<S>

Source§

type S = S

Source§

impl<S: Simd> ExtractToken for i64x2<S>

Source§

type S = S

Source§

impl<S: Simd> ExtractToken for i64x4<S>

Source§

type S = S

Source§

impl<S: Simd> ExtractToken for i64x8<S>

Source§

type S = S

Source§

impl<S: Simd> ExtractToken for mask8x16<S>

Source§

type S = S

Source§

impl<S: Simd> ExtractToken for mask8x32<S>

Source§

type S = S

Source§

impl<S: Simd> ExtractToken for mask8x64<S>

Source§

type S = S

Source§

impl<S: Simd> ExtractToken for mask16x8<S>

Source§

type S = S

Source§

impl<S: Simd> ExtractToken for mask16x16<S>

Source§

type S = S

Source§

impl<S: Simd> ExtractToken for mask16x32<S>

Source§

type S = S

Source§

impl<S: Simd> ExtractToken for mask32x4<S>

Source§

type S = S

Source§

impl<S: Simd> ExtractToken for mask32x8<S>

Source§

type S = S

Source§

impl<S: Simd> ExtractToken for mask32x16<S>

Source§

type S = S

Source§

impl<S: Simd> ExtractToken for mask64x2<S>

Source§

type S = S

Source§

impl<S: Simd> ExtractToken for mask64x4<S>

Source§

type S = S

Source§

impl<S: Simd> ExtractToken for mask64x8<S>

Source§

type S = S

Source§

impl<S: Simd> ExtractToken for u8x16<S>

Source§

type S = S

Source§

impl<S: Simd> ExtractToken for u8x32<S>

Source§

type S = S

Source§

impl<S: Simd> ExtractToken for u8x64<S>

Source§

type S = S

Source§

impl<S: Simd> ExtractToken for u16x8<S>

Source§

type S = S

Source§

impl<S: Simd> ExtractToken for u16x16<S>

Source§

type S = S

Source§

impl<S: Simd> ExtractToken for u16x32<S>

Source§

type S = S

Source§

impl<S: Simd> ExtractToken for u32x4<S>

Source§

type S = S

Source§

impl<S: Simd> ExtractToken for u32x8<S>

Source§

type S = S

Source§

impl<S: Simd> ExtractToken for u32x16<S>

Source§

type S = S

Source§

impl<S: Simd> ExtractToken for u64x2<S>

Source§

type S = S

Source§

impl<S: Simd> ExtractToken for u64x4<S>

Source§

type S = S

Source§

impl<S: Simd> ExtractToken for u64x8<S>

Source§

type S = S