pub struct SliceMutSource<'k, K> {
pub slice: &'k mut [K],
pub len: usize,
}Expand description
Implements KeySet, storing keys in the mutable slice.
Retain operations reorder the slice, putting retained keys at the beginning of the slice.
Fields§
§slice: &'k mut [K]All keys (retained ones occupy len beginning indices).
len: usizeHow many first keys are retained.
Implementations§
Trait Implementations§
Source§impl<'k, K> From<&'k mut [K]> for SliceMutSource<'k, K>
impl<'k, K> From<&'k mut [K]> for SliceMutSource<'k, K>
Source§impl<'k, K: Sync> KeySet<K> for SliceMutSource<'k, K>
impl<'k, K: Sync> KeySet<K> for SliceMutSource<'k, K>
Source§fn has_par_for_each_key(&self) -> bool
fn has_par_for_each_key(&self) -> bool
Returns
true only if Self::par_for_each_key can use multiple threads.Source§fn for_each_key<F, P>(&self, f: F, _retained_hint: P)
fn for_each_key<F, P>(&self, f: F, _retained_hint: P)
Call
f for each key in the set, using single thread. Read moreSource§fn par_for_each_key<F, P>(&self, f: F, _retained_hint: P)
fn par_for_each_key<F, P>(&self, f: F, _retained_hint: P)
Multi-threaded version of
for_each_key.Source§fn map_each_key<R, M, P>(&self, map: M, _retained_hint: P) -> Vec<R>
fn map_each_key<R, M, P>(&self, map: M, _retained_hint: P) -> Vec<R>
Calls
map for each key in the set, and returns outputs of these calls. Uses single thread. Read moreSource§fn par_map_each_key<R, M, P>(&self, map: M, _retained_hint: P) -> Vec<R>
fn par_map_each_key<R, M, P>(&self, map: M, _retained_hint: P) -> Vec<R>
Multi-threaded version of
map_each_key.Source§fn retain_keys<F, P, R>(
&mut self,
filter: F,
_retained_hint: P,
_remove_count: R,
)
fn retain_keys<F, P, R>( &mut self, filter: F, _retained_hint: P, _remove_count: R, )
Source§fn maybe_par_map_each_key<R, M, P>(
&self,
map: M,
retained_hint: P,
use_mt: bool,
) -> Vec<R>
fn maybe_par_map_each_key<R, M, P>( &self, map: M, retained_hint: P, use_mt: bool, ) -> Vec<R>
Calls either
map_each_key (if use_mt is false) or par_map_each_key (if use_mt is true).Source§fn par_retain_keys<F, P, R>(
&mut self,
filter: F,
retained_earlier: P,
remove_count: R,
)
fn par_retain_keys<F, P, R>( &mut self, filter: F, retained_earlier: P, remove_count: R, )
Multi-threaded version of
retain_keys.Source§fn maybe_par_retain_keys<F, P, R>(
&mut self,
filter: F,
retained_earlier: P,
remove_count: R,
use_mt: bool,
)
fn maybe_par_retain_keys<F, P, R>( &mut self, filter: F, retained_earlier: P, remove_count: R, use_mt: bool, )
Calls either
retain_keys (if use_mt is false) or par_retain_keys (if use_mt is true).Source§fn retain_keys_with_indices<IF, F, P, R>(
&mut self,
_index_filter: IF,
filter: F,
retained_earlier: P,
remove_count: R,
)
fn retain_keys_with_indices<IF, F, P, R>( &mut self, _index_filter: IF, filter: F, retained_earlier: P, remove_count: R, )
Retains in
self keys pointed by the index_filter
(or filter if self does not support index_filter)
and remove the rest.
Uses single thread. Read moreSource§fn par_retain_keys_with_indices<IF, F, P, R>(
&mut self,
_index_filter: IF,
filter: F,
retained_earlier: P,
remove_count: R,
)
fn par_retain_keys_with_indices<IF, F, P, R>( &mut self, _index_filter: IF, filter: F, retained_earlier: P, remove_count: R, )
Multi-threaded version of
retain_keys_with_indices.Source§fn maybe_par_retain_keys_with_indices<IF, F, P, R>(
&mut self,
index_filter: IF,
filter: F,
retained_earlier: P,
remove_count: R,
use_mt: bool,
)
fn maybe_par_retain_keys_with_indices<IF, F, P, R>( &mut self, index_filter: IF, filter: F, retained_earlier: P, remove_count: R, use_mt: bool, )
Calls either
retain_keys_with_indices (if use_mt is false) or par_retain_keys_with_indices (if use_mt is true).Auto Trait Implementations§
impl<'k, K> Freeze for SliceMutSource<'k, K>
impl<'k, K> RefUnwindSafe for SliceMutSource<'k, K>where
K: RefUnwindSafe,
impl<'k, K> Send for SliceMutSource<'k, K>where
K: Send,
impl<'k, K> Sync for SliceMutSource<'k, K>where
K: Sync,
impl<'k, K> Unpin for SliceMutSource<'k, K>
impl<'k, K> UnsafeUnpin for SliceMutSource<'k, K>
impl<'k, K> !UnwindSafe for SliceMutSource<'k, K>
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
Mutably borrows from an owned value. Read more
Source§impl<T, U> CastableInto<U> for Twhere
U: CastableFrom<T>,
impl<T, U> CastableInto<U> for Twhere
U: CastableFrom<T>,
Source§impl<T> DowncastableFrom<T> for T
impl<T> DowncastableFrom<T> for T
Source§fn downcast_from(value: T) -> T
fn downcast_from(value: T) -> T
Truncate the current UnsignedInt to a possibly smaller size
Source§impl<T, U> DowncastableInto<U> for Twhere
U: DowncastableFrom<T>,
impl<T, U> DowncastableInto<U> for Twhere
U: DowncastableFrom<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>
Converts
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>
Converts
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> UpcastableFrom<T> for T
impl<T> UpcastableFrom<T> for T
Source§fn upcast_from(value: T) -> T
fn upcast_from(value: T) -> T
Extend the current UnsignedInt to a possibly bigger size.