pub struct MemoryReclaimOnThreshold<const D: usize>(/* private fields */);
Expand description
A MemoryReclaimPolicy
which reclaims all closed nodes whenever the utilization falls below a threshold.
The threshold is a function of the constant generic parameter D
.
Specifically, memory of closed nodes will be reclaimed whenever the ratio of closed nodes to all nodes exceeds one over 2^D
.
- when
D = 0
: memory will be reclaimed when utilization is below 0.00% (equivalent to never). - when
D = 1
: memory will be reclaimed when utilization is below 50.00%. - when
D = 2
: memory will be reclaimed when utilization is below 75.00%. - when
D = 3
: memory will be reclaimed when utilization is below 87.50%. - when
D = 4
: memory will be reclaimed when utilization is below 93.75%. - …
Trait Implementations§
source§impl<const D: usize> Clone for MemoryReclaimOnThreshold<D>
impl<const D: usize> Clone for MemoryReclaimOnThreshold<D>
source§fn clone(&self) -> MemoryReclaimOnThreshold<D>
fn clone(&self) -> MemoryReclaimOnThreshold<D>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<const D: usize> Default for MemoryReclaimOnThreshold<D>
impl<const D: usize> Default for MemoryReclaimOnThreshold<D>
source§fn default() -> MemoryReclaimOnThreshold<D>
fn default() -> MemoryReclaimOnThreshold<D>
Returns the “default value” for a type. Read more
source§impl<const D: usize> MemoryReclaimPolicy for MemoryReclaimOnThreshold<D>
impl<const D: usize> MemoryReclaimPolicy for MemoryReclaimOnThreshold<D>
source§fn reclaim_closed_nodes<'rf, 'a, V, T, P>(
vec_mut: &mut SelfRefColMut<'rf, 'a, V, T, P>,
)where
T: 'a,
V: Variant<'a, T, Storage = NodeDataLazyClose<T>>,
P: PinnedVec<Node<'a, V, T>> + 'a,
SelfRefColMut<'rf, 'a, V, T, P>: Reclaim<<V as Variant<'a, T>>::Prev, <V as Variant<'a, T>>::Next>,
fn reclaim_closed_nodes<'rf, 'a, V, T, P>(
vec_mut: &mut SelfRefColMut<'rf, 'a, V, T, P>,
)where
T: 'a,
V: Variant<'a, T, Storage = NodeDataLazyClose<T>>,
P: PinnedVec<Node<'a, V, T>> + 'a,
SelfRefColMut<'rf, 'a, V, T, P>: Reclaim<<V as Variant<'a, T>>::Prev, <V as Variant<'a, T>>::Next>,
Manually attempts to reclaim closed nodes. Read more
source§fn at_the_same_state_as(&self, collection: &MemoryReclaimOnThreshold<D>) -> bool
fn at_the_same_state_as(&self, collection: &MemoryReclaimOnThreshold<D>) -> bool
Returns whether or not two self referential collections are the same memory state or not.
This method is used internally to check validity of
NodeIndex
es.source§fn successor_state(&self) -> MemoryReclaimOnThreshold<D>
fn successor_state(&self) -> MemoryReclaimOnThreshold<D>
Provides the state succeeding the current memory state.
impl<const D: usize> Copy for MemoryReclaimOnThreshold<D>
Auto Trait Implementations§
impl<const D: usize> Freeze for MemoryReclaimOnThreshold<D>
impl<const D: usize> RefUnwindSafe for MemoryReclaimOnThreshold<D>
impl<const D: usize> Send for MemoryReclaimOnThreshold<D>
impl<const D: usize> Sync for MemoryReclaimOnThreshold<D>
impl<const D: usize> Unpin for MemoryReclaimOnThreshold<D>
impl<const D: usize> UnwindSafe for MemoryReclaimOnThreshold<D>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)