pub struct SliceGroupMut<'a, E: Entity, T: 'a = <E as Entity>::Unit>(/* private fields */);
Expand description
Analogous to a mutable reference to a slice for groups.
Implementations§
Source§impl<'a, E: Entity, T> SliceGroupMut<'a, E, T>
impl<'a, E: Entity, T> SliceGroupMut<'a, E, T>
Sourcepub fn new(slice: GroupFor<E, &'a mut [T]>) -> Self
pub fn new(slice: GroupFor<E, &'a mut [T]>) -> Self
Create a new SliceGroup
from a group of mutable slice references.
Sourcepub fn into_inner(self) -> GroupFor<E, &'a mut [T]>
pub fn into_inner(self) -> GroupFor<E, &'a mut [T]>
Consume self
to return the internally stored group of mutable slice references.
Sourcepub 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
.
Source§impl<'a, E: Entity> SliceGroupMut<'a, E>
impl<'a, E: Entity> SliceGroupMut<'a, E>
Sourcepub 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()
.
Sourcepub 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()
.
Source§impl<'a, E: Entity, T> SliceGroupMut<'a, E, T>
impl<'a, E: Entity, T> SliceGroupMut<'a, E, T>
Sourcepub 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
.
Sourcepub 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()
.
Sourcepub 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
.
Sourcepub unsafe fn get_unchecked(self, idx: usize) -> RefGroup<'a, E, T>
pub unsafe fn get_unchecked(self, idx: usize) -> RefGroup<'a, E, T>
Sourcepub fn subslice(self, range: Range<usize>) -> Self
pub fn subslice(self, range: Range<usize>) -> Self
Returns the subslice of self
from the start to the end of the provided range.
Sourcepub unsafe fn subslice_unchecked(self, range: Range<usize>) -> Self
pub unsafe fn subslice_unchecked(self, range: Range<usize>) -> Self
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()
.
Sourcepub 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.
Sourcepub fn split_at(self, idx: usize) -> (Self, Self)
pub fn split_at(self, idx: usize) -> (Self, Self)
Split self
at the midpoint idx
, and return the two parts.
Sourcepub fn into_chunks_exact(
self,
chunk_size: usize,
) -> (impl Iterator<Item = SliceGroupMut<'a, E, T>>, Self)
pub fn into_chunks_exact( self, chunk_size: usize, ) -> (impl Iterator<Item = SliceGroupMut<'a, E, T>>, Self)
Returns an iterator of slices over chunks of size chunk_size
, and the remainder of
the slice.
Trait Implementations§
Source§impl<'a, E: Entity, T> IntoConst for SliceGroupMut<'a, E, T>
impl<'a, E: Entity, T> IntoConst for SliceGroupMut<'a, E, T>
type Target = SliceGroup<'a, E, T>
fn into_const(self) -> Self::Target
Source§impl<'short, 'a, E: Entity, T> Reborrow<'short> for SliceGroupMut<'a, E, T>
impl<'short, 'a, E: Entity, T> Reborrow<'short> for SliceGroupMut<'a, E, T>
Source§impl<'short, 'a, E: Entity, T> ReborrowMut<'short> for SliceGroupMut<'a, E, T>
impl<'short, 'a, E: Entity, T> ReborrowMut<'short> for SliceGroupMut<'a, E, T>
impl<E: Entity, T: Send> Send for SliceGroupMut<'_, E, T>
impl<E: Entity, T: Sync> 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