pub struct ArenaStats {
pub capacity: usize,
pub allocated: usize,
pub free: usize,
pub fragmentation: f32,
}Expand description
Statistics about arena usage.
Fields§
§capacity: usizeTotal capacity of the arena.
allocated: usizeNumber of currently allocated cells.
free: usizeNumber of free cells.
fragmentation: f32Fragmentation ratio (0.0 = not fragmented, 1.0 = highly fragmented).
Implementations§
Source§impl ArenaStats
impl ArenaStats
Sourcepub fn usage_percent(&self) -> f32
pub fn usage_percent(&self) -> f32
Get usage as a percentage (0-100).
Sourcepub fn free_percent(&self) -> f32
pub fn free_percent(&self) -> f32
Get free space as a percentage (0-100).
Sourcepub fn is_fragmented(&self, threshold: f32) -> bool
pub fn is_fragmented(&self, threshold: f32) -> bool
Check if fragmentation is above a threshold.
Trait Implementations§
Source§impl Clone for ArenaStats
impl Clone for ArenaStats
Source§fn clone(&self) -> ArenaStats
fn clone(&self) -> ArenaStats
Returns a duplicate 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 Debug for ArenaStats
impl Debug for ArenaStats
Source§impl Default for ArenaStats
impl Default for ArenaStats
Source§fn default() -> ArenaStats
fn default() -> ArenaStats
Returns the “default value” for a type. Read more
Source§impl PartialEq for ArenaStats
impl PartialEq for ArenaStats
impl Copy for ArenaStats
impl StructuralPartialEq for ArenaStats
Auto Trait Implementations§
impl Freeze for ArenaStats
impl RefUnwindSafe for ArenaStats
impl Send for ArenaStats
impl Sync for ArenaStats
impl Unpin for ArenaStats
impl UnsafeUnpin for ArenaStats
impl UnwindSafe for ArenaStats
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