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§
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 as Iterator>::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>(
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>
fn copy<T>(group: &Self::Group<T>) -> Self::Group<T>where
T: Copy,
Object Safety§
This trait is not object safe.