Struct ph::fmph::keyset::SliceSourceWithRefs
source · 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> RefUnwindSafe for SliceSourceWithRefs<'k, K, I>where
I: RefUnwindSafe,
K: 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> UnwindSafe for SliceSourceWithRefs<'k, K, I>where
I: UnwindSafe,
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