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§
Required Methods§
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
impl<T: ExtractToken + ?Sized> ExtractToken for &T
Source§impl<T: ExtractToken + ?Sized> ExtractToken for &mut T
impl<T: ExtractToken + ?Sized> ExtractToken for &mut T
Implementors§
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.
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.