pub struct ImmutableSlice<'k, K> { /* private fields */ }Expand description
Implements KeySet that use immutable slice.
It does not use any index for pointing remain keys.
That is why it is recommended to use it with CachedKeySet.
Implementations§
Source§impl<'k, K: Sync> ImmutableSlice<'k, K>
impl<'k, K: Sync> ImmutableSlice<'k, K>
pub fn new(slice: &'k [K]) -> Self
pub fn cached( slice: &[K], clone_threshold: usize, ) -> CachedKeySet<K, ImmutableSlice<'_, K>>
Trait Implementations§
Source§impl<'k, K: Sync + Send + Clone> KeySet<K> for ImmutableSlice<'k, K>
impl<'k, K: Sync + Send + Clone> KeySet<K> for ImmutableSlice<'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 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_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 retain_keys<F, P, R>(
&mut self,
_filter: F,
_retained_earlier: P,
remove_count: R,
)
fn retain_keys<F, P, R>( &mut self, _filter: F, _retained_earlier: P, remove_count: R, )
Source§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 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 ImmutableSlice<'k, K>
impl<'k, K> RefUnwindSafe for ImmutableSlice<'k, K>where
K: RefUnwindSafe,
impl<'k, K> Send for ImmutableSlice<'k, K>where
K: Sync,
impl<'k, K> Sync for ImmutableSlice<'k, K>where
K: Sync,
impl<'k, K> Unpin for ImmutableSlice<'k, K>
impl<'k, K> UnsafeUnpin for ImmutableSlice<'k, K>
impl<'k, K> UnwindSafe for ImmutableSlice<'k, K>where
K: 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
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.