Trait faer_core::Entity

source ·
pub unsafe trait Entity: Copy + Pod + PartialEq + Send + Sync + Debug + 'static {
    type Unit: Copy + Pod + Send + Sync + Debug + 'static;
    type Index: Copy + Pod + Send + Sync + Debug + 'static;
    type SimdUnit<S: Simd>: Copy + Pod + Send + Sync + Debug + 'static;
    type SimdMask<S: Simd>: Copy + Send + Sync + Debug + 'static;
    type SimdIndex<S: Simd>: Copy + Send + Sync + Debug + 'static;
    type Group<T>;
    type GroupCopy<T: Copy>: Copy;
    type Iter<I: Iterator>: Iterator<Item = Self::Group<<I as Iterator>::Item>>;

    const N_COMPONENTS: usize;
    const UNIT: Self::GroupCopy<()>;
Show 22 methods // Required methods fn from_units(group: Self::Group<Self::Unit>) -> Self; fn into_units(self) -> Self::Group<Self::Unit>; fn as_ref<T>(group: &Self::Group<T>) -> Self::Group<&T>; fn as_mut<T>(group: &mut Self::Group<T>) -> Self::Group<&mut T>; fn map<T, U>(group: Self::Group<T>, f: impl FnMut(T) -> U) -> Self::Group<U>; fn zip<T, U>( first: Self::Group<T>, second: Self::Group<U> ) -> Self::Group<(T, U)>; fn unzip<T, U>( zipped: Self::Group<(T, U)> ) -> (Self::Group<T>, Self::Group<U>); fn map_with_context<Ctx, T, U>( ctx: Ctx, group: Self::Group<T>, f: impl FnMut(Ctx, T) -> (Ctx, U) ) -> (Ctx, Self::Group<U>); fn into_iter<I>( iter: Self::Group<I> ) -> Self::Iter<<I as IntoIterator>::IntoIter> where I: IntoIterator; // Provided methods fn unzip2<T>(zipped: Self::Group<[T; 2]>) -> [Self::Group<T>; 2] { ... } fn unzip4<T>(zipped: Self::Group<[T; 4]>) -> [Self::Group<T>; 4] { ... } fn unzip8<T>(zipped: Self::Group<[T; 8]>) -> [Self::Group<T>; 8] { ... } fn as_arrays<const N: usize, T>( group: Self::Group<&[T]> ) -> (Self::Group<&[[T; N]]>, Self::Group<&[T]>) { ... } fn as_arrays_mut<const N: usize, T>( group: Self::Group<&mut [T]> ) -> (Self::Group<&mut [[T; N]]>, Self::Group<&mut [T]>) { ... } fn deref<T>(group: Self::Group<&T>) -> Self::Group<T> where T: Copy { ... } fn rb<'short, T>( value: Self::Group<&'short T> ) -> Self::Group<<T as Reborrow<'short>>::Target> where T: Reborrow<'short> { ... } fn rb_mut<'short, T>( value: Self::Group<&'short mut T> ) -> Self::Group<<T as ReborrowMut<'short>>::Target> where T: ReborrowMut<'short> { ... } fn into_const<T>( value: Self::Group<T> ) -> Self::Group<<T as IntoConst>::Target> where T: IntoConst { ... } fn from_copy<T>(group: Self::GroupCopy<T>) -> Self::Group<T> where T: Copy { ... } fn into_copy<T>(group: Self::Group<T>) -> Self::GroupCopy<T> where T: Copy { ... } fn map_copy<T, U>( group: Self::GroupCopy<T>, f: impl FnMut(T) -> U ) -> Self::GroupCopy<U> where T: Copy, U: Copy { ... } fn copy<T>(group: &Self::Group<T>) -> Self::Group<T> where T: Copy { ... }
}
Expand description

Unstable core trait for describing how a scalar value may be split up into individual component.

For example, f64 is treated as a single indivisible unit, but num_complex::Complex<f64> is split up into its real and imaginary components, with each one being stored in a separate container.

Safety

The associated types and functions must fulfill their respective contracts.

Required Associated Types§

source

type Unit: Copy + Pod + Send + Sync + Debug + 'static

source

type Index: Copy + Pod + Send + Sync + Debug + 'static

source

type SimdUnit<S: Simd>: Copy + Pod + Send + Sync + Debug + 'static

source

type SimdMask<S: Simd>: Copy + Send + Sync + Debug + 'static

source

type SimdIndex<S: Simd>: Copy + Send + Sync + Debug + 'static

source

type Group<T>

If Group<()> == (), then that must imply Group<T> == T.

source

type GroupCopy<T: Copy>: Copy

Must be the same as Group<T>.

source

type Iter<I: Iterator>: Iterator<Item = Self::Group<<I as Iterator>::Item>>

Required Associated Constants§

Required Methods§

source

fn from_units(group: Self::Group<Self::Unit>) -> Self

source

fn into_units(self) -> Self::Group<Self::Unit>

source

fn as_ref<T>(group: &Self::Group<T>) -> Self::Group<&T>

source

fn as_mut<T>(group: &mut Self::Group<T>) -> Self::Group<&mut T>

source

fn map<T, U>(group: Self::Group<T>, f: impl FnMut(T) -> U) -> Self::Group<U>

source

fn zip<T, U>( first: Self::Group<T>, second: Self::Group<U> ) -> Self::Group<(T, U)>

source

fn unzip<T, U>(zipped: Self::Group<(T, U)>) -> (Self::Group<T>, Self::Group<U>)

source

fn map_with_context<Ctx, T, U>( ctx: Ctx, group: Self::Group<T>, f: impl FnMut(Ctx, T) -> (Ctx, U) ) -> (Ctx, Self::Group<U>)

source

fn into_iter<I>( iter: Self::Group<I> ) -> Self::Iter<<I as IntoIterator>::IntoIter>
where I: IntoIterator,

Provided Methods§

source

fn unzip2<T>(zipped: Self::Group<[T; 2]>) -> [Self::Group<T>; 2]

source

fn unzip4<T>(zipped: Self::Group<[T; 4]>) -> [Self::Group<T>; 4]

source

fn unzip8<T>(zipped: Self::Group<[T; 8]>) -> [Self::Group<T>; 8]

source

fn as_arrays<const N: usize, T>( group: Self::Group<&[T]> ) -> (Self::Group<&[[T; N]]>, Self::Group<&[T]>)

source

fn as_arrays_mut<const N: usize, T>( group: Self::Group<&mut [T]> ) -> (Self::Group<&mut [[T; N]]>, Self::Group<&mut [T]>)

source

fn deref<T>(group: Self::Group<&T>) -> Self::Group<T>
where T: Copy,

source

fn rb<'short, T>( value: Self::Group<&'short T> ) -> Self::Group<<T as Reborrow<'short>>::Target>
where T: Reborrow<'short>,

source

fn rb_mut<'short, T>( value: Self::Group<&'short mut T> ) -> Self::Group<<T as ReborrowMut<'short>>::Target>
where T: ReborrowMut<'short>,

source

fn into_const<T>(value: Self::Group<T>) -> Self::Group<<T as IntoConst>::Target>
where T: IntoConst,

source

fn from_copy<T>(group: Self::GroupCopy<T>) -> Self::Group<T>
where T: Copy,

source

fn into_copy<T>(group: Self::Group<T>) -> Self::GroupCopy<T>
where T: Copy,

source

fn map_copy<T, U>( group: Self::GroupCopy<T>, f: impl FnMut(T) -> U ) -> Self::GroupCopy<U>
where T: Copy, U: Copy,

source

fn copy<T>(group: &Self::Group<T>) -> Self::Group<T>
where T: Copy,

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Entity for f32

§

type Unit = f32

§

type Index = u32

§

type SimdUnit<S: Simd> = <S as Simd>::f32s

§

type SimdMask<S: Simd> = <S as Simd>::m32s

§

type SimdIndex<S: Simd> = <S as Simd>::u32s

§

type Group<T> = T

§

type GroupCopy<T: Copy> = T

§

type Iter<I: Iterator> = I

source§

const N_COMPONENTS: usize = 1usize

source§

const UNIT: <f32 as Entity>::GroupCopy<()> = ()

source§

fn from_units(group: <f32 as Entity>::Group<<f32 as Entity>::Unit>) -> f32

source§

fn into_units(self) -> <f32 as Entity>::Group<<f32 as Entity>::Unit>

source§

fn as_ref<T>(group: &<f32 as Entity>::Group<T>) -> <f32 as Entity>::Group<&T>

source§

fn as_mut<T>( group: &mut <f32 as Entity>::Group<T> ) -> <f32 as Entity>::Group<&mut T>

source§

fn map<T, U>( group: <f32 as Entity>::Group<T>, f: impl FnMut(T) -> U ) -> <f32 as Entity>::Group<U>

source§

fn map_with_context<Ctx, T, U>( ctx: Ctx, group: <f32 as Entity>::Group<T>, f: impl FnMut(Ctx, T) -> (Ctx, U) ) -> (Ctx, <f32 as Entity>::Group<U>)

source§

fn zip<T, U>( first: <f32 as Entity>::Group<T>, second: <f32 as Entity>::Group<U> ) -> <f32 as Entity>::Group<(T, U)>

source§

fn unzip<T, U>( zipped: <f32 as Entity>::Group<(T, U)> ) -> (<f32 as Entity>::Group<T>, <f32 as Entity>::Group<U>)

source§

fn into_iter<I>( iter: <f32 as Entity>::Group<I> ) -> <f32 as Entity>::Iter<<I as IntoIterator>::IntoIter>
where I: IntoIterator,

source§

fn from_copy<T>( group: <f32 as Entity>::GroupCopy<T> ) -> <f32 as Entity>::Group<T>
where T: Copy,

source§

fn into_copy<T>( group: <f32 as Entity>::Group<T> ) -> <f32 as Entity>::GroupCopy<T>
where T: Copy,

source§

impl Entity for f64

§

type Unit = f64

§

type Index = u64

§

type SimdUnit<S: Simd> = <S as Simd>::f64s

§

type SimdMask<S: Simd> = <S as Simd>::m64s

§

type SimdIndex<S: Simd> = <S as Simd>::u64s

§

type Group<T> = T

§

type GroupCopy<T: Copy> = T

§

type Iter<I: Iterator> = I

source§

const N_COMPONENTS: usize = 1usize

source§

const UNIT: <f64 as Entity>::GroupCopy<()> = ()

source§

fn from_units(group: <f64 as Entity>::Group<<f64 as Entity>::Unit>) -> f64

source§

fn into_units(self) -> <f64 as Entity>::Group<<f64 as Entity>::Unit>

source§

fn as_ref<T>(group: &<f64 as Entity>::Group<T>) -> <f64 as Entity>::Group<&T>

source§

fn as_mut<T>( group: &mut <f64 as Entity>::Group<T> ) -> <f64 as Entity>::Group<&mut T>

source§

fn map<T, U>( group: <f64 as Entity>::Group<T>, f: impl FnMut(T) -> U ) -> <f64 as Entity>::Group<U>

source§

fn map_with_context<Ctx, T, U>( ctx: Ctx, group: <f64 as Entity>::Group<T>, f: impl FnMut(Ctx, T) -> (Ctx, U) ) -> (Ctx, <f64 as Entity>::Group<U>)

source§

fn zip<T, U>( first: <f64 as Entity>::Group<T>, second: <f64 as Entity>::Group<U> ) -> <f64 as Entity>::Group<(T, U)>

source§

fn unzip<T, U>( zipped: <f64 as Entity>::Group<(T, U)> ) -> (<f64 as Entity>::Group<T>, <f64 as Entity>::Group<U>)

source§

fn into_iter<I>( iter: <f64 as Entity>::Group<I> ) -> <f64 as Entity>::Iter<<I as IntoIterator>::IntoIter>
where I: IntoIterator,

source§

fn from_copy<T>( group: <f64 as Entity>::GroupCopy<T> ) -> <f64 as Entity>::Group<T>
where T: Copy,

source§

fn into_copy<T>( group: <f64 as Entity>::Group<T> ) -> <f64 as Entity>::GroupCopy<T>
where T: Copy,

source§

impl<E> Entity for Complex<E>
where E: Entity,

§

type Unit = <E as Entity>::Unit

§

type Index = <E as Entity>::Index

§

type SimdUnit<S: Simd> = <E as Entity>::SimdUnit<S>

§

type SimdMask<S: Simd> = <E as Entity>::SimdMask<S>

§

type SimdIndex<S: Simd> = <E as Entity>::SimdIndex<S>

§

type Group<T> = Complex<<E as Entity>::Group<T>>

§

type GroupCopy<T: Copy> = Complex<<E as Entity>::GroupCopy<T>>

§

type Iter<I: Iterator> = ComplexIter<<E as Entity>::Iter<I>>

source§

const N_COMPONENTS: usize = _

source§

const UNIT: <Complex<E> as Entity>::GroupCopy<()> = _

source§

fn from_units( group: <Complex<E> as Entity>::Group<<Complex<E> as Entity>::Unit> ) -> Complex<E>

source§

fn into_units( self ) -> <Complex<E> as Entity>::Group<<Complex<E> as Entity>::Unit>

source§

fn as_ref<T>( group: &<Complex<E> as Entity>::Group<T> ) -> <Complex<E> as Entity>::Group<&T>

source§

fn as_mut<T>( group: &mut <Complex<E> as Entity>::Group<T> ) -> <Complex<E> as Entity>::Group<&mut T>

source§

fn map<T, U>( group: <Complex<E> as Entity>::Group<T>, f: impl FnMut(T) -> U ) -> <Complex<E> as Entity>::Group<U>

source§

fn map_with_context<Ctx, T, U>( ctx: Ctx, group: <Complex<E> as Entity>::Group<T>, f: impl FnMut(Ctx, T) -> (Ctx, U) ) -> (Ctx, <Complex<E> as Entity>::Group<U>)

source§

fn zip<T, U>( first: <Complex<E> as Entity>::Group<T>, second: <Complex<E> as Entity>::Group<U> ) -> <Complex<E> as Entity>::Group<(T, U)>

source§

fn unzip<T, U>( zipped: <Complex<E> as Entity>::Group<(T, U)> ) -> (<Complex<E> as Entity>::Group<T>, <Complex<E> as Entity>::Group<U>)

source§

fn into_iter<I>( iter: <Complex<E> as Entity>::Group<I> ) -> <Complex<E> as Entity>::Iter<<I as IntoIterator>::IntoIter>
where I: IntoIterator,

Implementors§

source§

impl Entity for c32

§

type Unit = c32

§

type Index = u32

§

type SimdUnit<S: Simd> = <S as Simd>::c32s

§

type SimdMask<S: Simd> = <S as Simd>::m32s

§

type SimdIndex<S: Simd> = <S as Simd>::u32s

§

type Group<T> = T

§

type GroupCopy<T: Copy> = T

§

type Iter<I: Iterator> = I

source§

const N_COMPONENTS: usize = 1usize

source§

const UNIT: Self::GroupCopy<()> = ()

source§

impl Entity for c32conj

§

type Unit = c32conj

§

type Index = u32

§

type SimdUnit<S: Simd> = <S as Simd>::c32s

§

type SimdMask<S: Simd> = <S as Simd>::m32s

§

type SimdIndex<S: Simd> = <S as Simd>::u32s

§

type Group<T> = T

§

type GroupCopy<T: Copy> = T

§

type Iter<I: Iterator> = I

source§

const N_COMPONENTS: usize = 1usize

source§

const UNIT: Self::GroupCopy<()> = ()

source§

impl Entity for c64

§

type Unit = c64

§

type Index = u64

§

type SimdUnit<S: Simd> = <S as Simd>::c64s

§

type SimdMask<S: Simd> = <S as Simd>::m64s

§

type SimdIndex<S: Simd> = <S as Simd>::u64s

§

type Group<T> = T

§

type GroupCopy<T: Copy> = T

§

type Iter<I: Iterator> = I

source§

const N_COMPONENTS: usize = 1usize

source§

const UNIT: Self::GroupCopy<()> = ()

source§

impl Entity for c64conj

§

type Unit = c64conj

§

type Index = u64

§

type SimdUnit<S: Simd> = <S as Simd>::c64s

§

type SimdMask<S: Simd> = <S as Simd>::m64s

§

type SimdIndex<S: Simd> = <S as Simd>::u64s

§

type Group<T> = T

§

type GroupCopy<T: Copy> = T

§

type Iter<I: Iterator> = I

source§

const N_COMPONENTS: usize = 1usize

source§

const UNIT: Self::GroupCopy<()> = ()

source§

impl<E> Entity for ComplexConj<E>
where E: Entity,

§

type Unit = <E as Entity>::Unit

§

type Index = <E as Entity>::Index

§

type SimdUnit<S: Simd> = <E as Entity>::SimdUnit<S>

§

type SimdMask<S: Simd> = <E as Entity>::SimdMask<S>

§

type SimdIndex<S: Simd> = <E as Entity>::SimdIndex<S>

§

type Group<T> = ComplexConj<<E as Entity>::Group<T>>

§

type GroupCopy<T: Copy> = ComplexConj<<E as Entity>::GroupCopy<T>>

§

type Iter<I: Iterator> = ComplexConjIter<<E as Entity>::Iter<I>>

source§

const N_COMPONENTS: usize = _

source§

const UNIT: <ComplexConj<E> as Entity>::GroupCopy<()> = _