Trait faer_entity::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::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: IntoIterator>(
iter: Self::Group<I>
) -> Self::Iter<I::IntoIter>;
// 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: Copy>(group: Self::Group<&T>) -> Self::Group<T> { ... }
fn rb<'short, T: Reborrow<'short>>(
value: Self::Group<&'short T>
) -> Self::Group<T::Target> { ... }
fn rb_mut<'short, T: ReborrowMut<'short>>(
value: Self::Group<&'short mut T>
) -> Self::Group<T::Target> { ... }
fn into_const<T: IntoConst>(value: Self::Group<T>) -> Self::Group<T::Target> { ... }
fn from_copy<T: Copy>(group: Self::GroupCopy<T>) -> Self::Group<T> { ... }
fn into_copy<T: Copy>(group: Self::Group<T>) -> Self::GroupCopy<T> { ... }
fn map_copy<T: Copy, U: Copy>(
group: Self::GroupCopy<T>,
f: impl FnMut(T) -> U
) -> Self::GroupCopy<U> { ... }
fn copy<T: Copy>(group: &Self::Group<T>) -> Self::Group<T> { ... }
}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§
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 Iter<I: Iterator>: Iterator<Item = Self::Group<I::Item>>
Required Associated Constants§
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: IntoIterator>(iter: Self::Group<I>) -> Self::Iter<I::IntoIter>
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: Copy>(group: Self::Group<&T>) -> Self::Group<T>
fn rb<'short, T: Reborrow<'short>>( value: Self::Group<&'short T> ) -> Self::Group<T::Target>
fn rb_mut<'short, T: ReborrowMut<'short>>( value: Self::Group<&'short mut T> ) -> Self::Group<T::Target>
fn into_const<T: IntoConst>(value: Self::Group<T>) -> Self::Group<T::Target>
fn from_copy<T: Copy>(group: Self::GroupCopy<T>) -> Self::Group<T>
fn into_copy<T: Copy>(group: Self::Group<T>) -> Self::GroupCopy<T>
fn map_copy<T: Copy, U: Copy>( group: Self::GroupCopy<T>, f: impl FnMut(T) -> U ) -> Self::GroupCopy<U>
fn copy<T: Copy>(group: &Self::Group<T>) -> Self::Group<T>
Object Safety§
This trait is not object safe.