Struct SliceGroupMut
pub struct SliceGroupMut<'a, E, T = <E as Entity>::Unit>(<<E as Entity>::Group as ForType>::FaerOf<*mut [T]>, PhantomData<&'a mut ()>)
where
E: Entity,
T: 'a;
Expand description
Analogous to a mutable reference to a slice for groups.
Tuple Fields§
§0: <<E as Entity>::Group as ForType>::FaerOf<*mut [T]>
§1: PhantomData<&'a mut ()>
Implementations§
§impl<'a, E, T> SliceGroupMut<'a, E, T>where
E: Entity,
impl<'a, E, T> SliceGroupMut<'a, E, T>where
E: Entity,
pub fn new(
slice: <<E as Entity>::Group as ForType>::FaerOf<&'a mut [T]>,
) -> SliceGroupMut<'a, E, T>
pub fn new( slice: <<E as Entity>::Group as ForType>::FaerOf<&'a mut [T]>, ) -> SliceGroupMut<'a, E, T>
Create a new SliceGroup
from a group of mutable slice references.
pub fn into_inner(
self,
) -> <<E as Entity>::Group as ForType>::FaerOf<&'a mut [T]>
pub fn into_inner( self, ) -> <<E as Entity>::Group as ForType>::FaerOf<&'a mut [T]>
Consume self
to return the internally stored group of mutable slice references.
pub fn as_arrays_mut<const N: usize>(
self,
) -> (SliceGroupMut<'a, E, [T; N]>, SliceGroupMut<'a, E, T>)
pub fn as_arrays_mut<const N: usize>( self, ) -> (SliceGroupMut<'a, E, [T; N]>, SliceGroupMut<'a, E, T>)
Decompose self
into a mutable slice of arrays of size N
, and a remainder part with
length < N
.
§impl<'a, E> SliceGroupMut<'a, E>where
E: Entity,
impl<'a, E> SliceGroupMut<'a, E>where
E: Entity,
pub unsafe fn read_unchecked(&self, idx: usize) -> E
pub unsafe fn read_unchecked(&self, idx: usize) -> E
Read the element at position idx
, without bound checks.
§Safety
The behavior is undefined if idx >= self.len()
.
pub unsafe fn write_unchecked(&mut self, idx: usize, value: E)
pub unsafe fn write_unchecked(&mut self, idx: usize, value: E)
Write value
to the location at position idx
, without bound checks.
§Safety
The behavior is undefined if idx >= self.len()
.
pub fn fill_zero(&mut self)
pub fn fill_zero(&mut self)
Fill the slice with zeros.
§impl<'a, E, T> SliceGroupMut<'a, E, T>where
E: Entity,
impl<'a, E, T> SliceGroupMut<'a, E, T>where
E: Entity,
pub fn get_mut(self, idx: usize) -> RefGroupMut<'a, E, T>
pub fn get_mut(self, idx: usize) -> RefGroupMut<'a, E, T>
Get a RefGroupMut
pointing to the element at position idx
.
pub unsafe fn get_unchecked_mut(self, idx: usize) -> RefGroupMut<'a, E, T>
pub unsafe fn get_unchecked_mut(self, idx: usize) -> RefGroupMut<'a, E, T>
Get a RefGroupMut
pointing to the element at position idx
.
§Safety
The behavior is undefined if idx >= self.len()
.
pub fn get(self, idx: usize) -> RefGroup<'a, E, T>
pub fn get(self, idx: usize) -> RefGroup<'a, E, T>
Get a RefGroup
pointing to the element at position idx
.
pub unsafe fn get_unchecked(self, idx: usize) -> RefGroup<'a, E, T>
pub unsafe fn get_unchecked(self, idx: usize) -> RefGroup<'a, E, T>
pub fn subslice(self, range: Range<usize>) -> SliceGroupMut<'a, E, T>
pub fn subslice(self, range: Range<usize>) -> SliceGroupMut<'a, E, T>
Returns the subslice of self
from the start to the end of the provided range.
pub unsafe fn subslice_unchecked(
self,
range: Range<usize>,
) -> SliceGroupMut<'a, E, T>
pub unsafe fn subslice_unchecked( self, range: Range<usize>, ) -> SliceGroupMut<'a, E, T>
Returns the subslice of self
from the start to the end of the provided range, without
bound checks.
§Safety
The behavior is undefined if range.start > range.end
or range.end > self.len()
.
pub fn into_mut_iter(self) -> impl Iterator<Item = RefGroupMut<'a, E, T>>
pub fn into_mut_iter(self) -> impl Iterator<Item = RefGroupMut<'a, E, T>>
Returns an iterator of RefGroupMut
over the elements of the slice.
pub fn split_at(
self,
idx: usize,
) -> (SliceGroupMut<'a, E, T>, SliceGroupMut<'a, E, T>)
pub fn split_at( self, idx: usize, ) -> (SliceGroupMut<'a, E, T>, SliceGroupMut<'a, E, T>)
Split self
at the midpoint idx
, and return the two parts.
pub fn into_chunks_exact(
self,
chunk_size: usize,
) -> (impl Iterator<Item = SliceGroupMut<'a, E, T>>, SliceGroupMut<'a, E, T>)
pub fn into_chunks_exact( self, chunk_size: usize, ) -> (impl Iterator<Item = SliceGroupMut<'a, E, T>>, SliceGroupMut<'a, E, T>)
Returns an iterator of slices over chunks of size chunk_size
, and the remainder of
the slice.
Trait Implementations§
§impl<E, T> Debug for SliceGroupMut<'_, E, T>
impl<E, T> Debug for SliceGroupMut<'_, E, T>
§impl<'a, E, T> IntoConst for SliceGroupMut<'a, E, T>where
E: Entity,
impl<'a, E, T> IntoConst for SliceGroupMut<'a, E, T>where
E: Entity,
type Target = SliceGroup<'a, E, T>
fn into_const(self) -> <SliceGroupMut<'a, E, T> as IntoConst>::Target
§impl<'short, 'a, E, T> Reborrow<'short> for SliceGroupMut<'a, E, T>where
E: Entity,
impl<'short, 'a, E, T> Reborrow<'short> for SliceGroupMut<'a, E, T>where
E: Entity,
type Target = SliceGroup<'short, E, T>
fn rb(&'short self) -> <SliceGroupMut<'a, E, T> as Reborrow<'short>>::Target
§impl<'short, 'a, E, T> ReborrowMut<'short> for SliceGroupMut<'a, E, T>where
E: Entity,
impl<'short, 'a, E, T> ReborrowMut<'short> for SliceGroupMut<'a, E, T>where
E: Entity,
type Target = SliceGroupMut<'short, E, T>
fn rb_mut( &'short mut self, ) -> <SliceGroupMut<'a, E, T> as ReborrowMut<'short>>::Target
impl<E, T> Send for SliceGroupMut<'_, E, T>
impl<E, T> Sync for SliceGroupMut<'_, E, T>
Auto Trait Implementations§
impl<'a, E, T> Freeze for SliceGroupMut<'a, E, T>
impl<'a, E, T> RefUnwindSafe for SliceGroupMut<'a, E, T>
impl<'a, E, T> Unpin for SliceGroupMut<'a, E, T>
impl<'a, E, T = <E as Entity>::Unit> !UnwindSafe for SliceGroupMut<'a, E, T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more