pub struct Getter<'cont, T: 'cont> { /* private fields */ }Expand description
A 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 function of an associated container.
Implementations§
Source§impl<'cont, T> Getter<'cont, T>
impl<'cont, T> Getter<'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 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 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 num_chunks(&self) -> usize
pub fn num_chunks(&self) -> usize
Returns number of chunks.
Trait Implementations§
Source§impl<'cont, T> IntoIterator for Getter<'cont, T>
impl<'cont, T> IntoIterator for Getter<'cont, T>
Auto Trait Implementations§
impl<'cont, T> Freeze for Getter<'cont, T>
impl<'cont, T> RefUnwindSafe for Getter<'cont, T>where
T: RefUnwindSafe,
impl<'cont, T> Send for Getter<'cont, T>where
T: Sync,
impl<'cont, T> Sync for Getter<'cont, T>where
T: Sync,
impl<'cont, T> Unpin for Getter<'cont, T>
impl<'cont, T> UnwindSafe for Getter<'cont, T>where
T: RefUnwindSafe,
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