pub struct GetterMut<'cont, T: 'cont> { /* private fields */ }Expand description
A mutable getter that can be created from RawGetter with concrete type
and lifetime.
This getter is useful when you have RawGetter and know what type the
getter will return. You can create this getter from the RawGetter then
use it as a get_mut function of an associated container.
Implementations§
Source§impl<'cont, T> GetterMut<'cont, T>
impl<'cont, T> GetterMut<'cont, T>
Sourcepub fn get(&self, index: usize) -> Option<&T>
pub fn get(&self, index: usize) -> Option<&T>
Returns a shared reference to a value at the given index in the associated container.
Sourcepub unsafe fn get_unchecked(&self, index: usize) -> &T
pub unsafe fn get_unchecked(&self, index: usize) -> &T
Returns a shared reference to a value at the given index in the associated container.
§Safety
Undefined behavior if the given index is out of bounds.
Sourcepub fn get_mut(&mut self, index: usize) -> Option<&mut T>
pub fn get_mut(&mut self, index: usize) -> Option<&mut T>
Returns a mutable reference to a value at the given index in the associated container.
Sourcepub unsafe fn get_unchecked_mut(&mut self, index: usize) -> &mut T
pub unsafe fn get_unchecked_mut(&mut self, index: usize) -> &mut T
Returns a mutable reference to a value at the given index in the associated container.
§Safety
Undefined behavior if the given index is out of bounds.
Sourcepub fn iter(&self) -> FlatIter<'cont, T> ⓘ
pub fn iter(&self) -> FlatIter<'cont, T> ⓘ
Returns a sequential access iterator of the associated container.
But if you created the iterator from a RawGetter without calling
RawGetter::with_iter, this will panic.
§Panics
Panics if iterator geneartion function have not registered yet.
Sourcepub fn iter_mut(&mut self) -> FlatIterMut<'cont, T> ⓘ
pub fn iter_mut(&mut self) -> FlatIterMut<'cont, T> ⓘ
Returns a mutable sequential access iterator of the associated container.
But if you created the iterator from a RawGetter without calling
RawGetter::with_iter, this will panic.
§Panics
Panics if iterator geneartion function have not registered yet.
Sourcepub fn par_iter(&self) -> ParFlatIter<'cont, T>
pub fn par_iter(&self) -> ParFlatIter<'cont, T>
Returns a parallel iterator of the associated container.
But if you created the iterator from a RawGetter without calling
RawGetter::with_iter, this will panic.
§Panics
Panics if iterator geneartion function have not registered yet.
Sourcepub fn par_iter_mut(&mut self) -> ParFlatIterMut<'cont, T>
pub fn par_iter_mut(&mut self) -> ParFlatIterMut<'cont, T>
Returns a parallel mutable iterator of the associated container.
But if you created the iterator from a RawGetter without calling
RawGetter::with_iter, this will panic.
§Panics
Panics if iterator geneartion function have not registered yet.
Sourcepub fn num_chunks(&self) -> usize
pub fn num_chunks(&self) -> usize
Returns number of chunks.
Sourcepub fn as_slice(&self, chunk_index: usize) -> &[T]
pub fn as_slice(&self, chunk_index: usize) -> &[T]
Retrieves a shared slice for the given chunk index.
If the given chunk index is out of bounds, empty slice will be returned.
Sourcepub fn as_mut_slice(&mut self, chunk_index: usize) -> &mut [T]
pub fn as_mut_slice(&mut self, chunk_index: usize) -> &mut [T]
Retrieves a mutable slice for the given chunk index.
If the given chunk index is out of bounds, empty slice will be returned.
Trait Implementations§
Source§impl<'cont, T> IntoIterator for GetterMut<'cont, T>
impl<'cont, T> IntoIterator for GetterMut<'cont, T>
Source§impl<'cont, T: Send + Sync> IntoParallelIterator for GetterMut<'cont, T>
impl<'cont, T: Send + Sync> IntoParallelIterator for GetterMut<'cont, T>
Source§type Iter = ParFlatIterMut<'cont, T>
type Iter = ParFlatIterMut<'cont, T>
Source§type Item = &'cont mut T
type Item = &'cont mut T
Source§fn into_par_iter(self) -> Self::Iter
fn into_par_iter(self) -> Self::Iter
self into a parallel iterator. Read moreAuto Trait Implementations§
impl<'cont, T> Freeze for GetterMut<'cont, T>
impl<'cont, T> RefUnwindSafe for GetterMut<'cont, T>where
T: RefUnwindSafe,
impl<'cont, T> Send for GetterMut<'cont, T>where
T: Send,
impl<'cont, T> Sync for GetterMut<'cont, T>where
T: Sync,
impl<'cont, T> Unpin for GetterMut<'cont, T>
impl<'cont, T> !UnwindSafe for GetterMut<'cont, 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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