#[non_exhaustive]pub struct CollectOptions {
pub old_gen_threshold: usize,
pub kind: CollectionType,
}
Expand description
Provides settings which control how cycle-collection is performed.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.old_gen_threshold: usize
The number of times a pointer may be seen in the young gen before moving it to the old gen for a full tracing collection. Setting this to zero will cause all pointers to move to the old gen if they cannot be immediately cleaned up.
kind: CollectionType
The kind of collection to perform, e.g. just the young gen, or full tracing of both old & young gen.
Implementations§
Source§impl CollectOptions
impl CollectOptions
Sourcepub const DEFAULT: Self
pub const DEFAULT: Self
The default options for cycle collection. Items remain in the young gen for 5 cycles, and
both old and young gen will be process for each collection. These options will be used when
calling collect
Sourcepub const TRACE_AND_COLLECT_ALL: Self
pub const TRACE_AND_COLLECT_ALL: Self
Forces tracing collection for all items currently awaiting cleanup.
Sourcepub const YOUNG_ONLY: Self
pub const YOUNG_ONLY: Self
Only runs collection for the young generation. This will still move old items to the old gen.
Sourcepub const fn set_kind(self, kind: CollectionType) -> Self
pub const fn set_kind(self, kind: CollectionType) -> Self
Alter the CollectionType
performed when calling collect_with_options
.
Sourcepub const fn set_old_gen_threshold(self, threshold: usize) -> Self
pub const fn set_old_gen_threshold(self, threshold: usize) -> Self
Alter the number of times an item may be seen in the young generation before being moved to the old generation and traced.
Trait Implementations§
Source§impl Clone for CollectOptions
impl Clone for CollectOptions
Source§fn clone(&self) -> CollectOptions
fn clone(&self) -> CollectOptions
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for CollectOptions
impl Debug for CollectOptions
Source§impl Default for CollectOptions
impl Default for CollectOptions
Source§impl PartialEq for CollectOptions
impl PartialEq for CollectOptions
impl Copy for CollectOptions
impl Eq for CollectOptions
impl StructuralPartialEq for CollectOptions
Auto Trait Implementations§
impl Freeze for CollectOptions
impl RefUnwindSafe for CollectOptions
impl Send for CollectOptions
impl Sync for CollectOptions
impl Unpin for CollectOptions
impl UnwindSafe for CollectOptions
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.