pub struct SliceSourceWithRefs<'k, K, I: RefsIndex = u8> { /* private fields */ }Expand description
KeySet implementation that stores reference to slice with keys,
and indices of this slice that points retained keys.
Indices are stored partitioned to segments and stored as 8 (if I=u8) or 16-bit (if I=u16) integers.
Each segment covers $2^8$ or $2^{16}$ consecutive keys.
Empty segments are not stored.
Implementations§
Trait Implementations§
Source§impl<'k, K: Sync, I: RefsIndex + Sync + Send> KeySet<K> for SliceSourceWithRefs<'k, K, I>
impl<'k, K: Sync, I: RefsIndex + Sync + Send> KeySet<K> for SliceSourceWithRefs<'k, K, I>
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 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_earlier: P,
remove_count: R,
)
fn retain_keys<F, P, R>( &mut self, filter: F, _retained_earlier: P, remove_count: R, )
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 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 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 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 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 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, I> Freeze for SliceSourceWithRefs<'k, K, I>
impl<'k, K, I> RefUnwindSafe for SliceSourceWithRefs<'k, K, I>where
K: RefUnwindSafe,
I: RefUnwindSafe,
impl<'k, K, I> Send for SliceSourceWithRefs<'k, K, I>
impl<'k, K, I> Sync for SliceSourceWithRefs<'k, K, I>
impl<'k, K, I> Unpin for SliceSourceWithRefs<'k, K, I>where
I: Unpin,
impl<'k, K, I> UnsafeUnpin for SliceSourceWithRefs<'k, K, I>
impl<'k, K, I> UnwindSafe for SliceSourceWithRefs<'k, K, I>where
K: RefUnwindSafe,
I: UnwindSafe,
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.