pub struct GcStats {
pub marked: usize,
pub collected: usize,
pub total_before: usize,
}Expand description
Statistics returned by garbage collection.
Fields§
§marked: usizeNumber of objects that were marked as reachable.
collected: usizeNumber of objects that were collected (freed).
total_before: usizeNumber of objects that existed before collection.
Implementations§
Source§impl GcStats
impl GcStats
Sourcepub const fn did_collect(&self) -> bool
pub const fn did_collect(&self) -> bool
Check if any garbage was collected.
Sourcepub fn collection_ratio(&self) -> f32
pub fn collection_ratio(&self) -> f32
Get the collection ratio (0.0 to 1.0).
Returns 0.0 if no objects existed before collection.
Sourcepub fn survival_ratio(&self) -> f32
pub fn survival_ratio(&self) -> f32
Get the survival ratio (0.0 to 1.0).
Returns 1.0 if no objects existed before collection.
Trait Implementations§
impl Copy for GcStats
impl Eq for GcStats
impl StructuralPartialEq for GcStats
Auto Trait Implementations§
impl Freeze for GcStats
impl RefUnwindSafe for GcStats
impl Send for GcStats
impl Sync for GcStats
impl Unpin for GcStats
impl UnwindSafe for GcStats
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