Skip to main content

oxilean_runtime/arena/
arenastats_traits.rs

1//! # ArenaStats - Trait Implementations
2//!
3//! This module contains trait implementations for `ArenaStats`.
4//!
5//! ## Implemented Traits
6//!
7//! - `Display`
8//!
9//! 🤖 Generated with [SplitRS](https://github.com/cool-japan/splitrs)
10
11use super::types::ArenaStats;
12use std::fmt;
13
14impl fmt::Display for ArenaStats {
15    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
16        writeln!(f, "Arena Statistics:")?;
17        writeln!(f, "  Total allocations: {}", self.total_allocations)?;
18        writeln!(f, "  Total bytes:       {}", self.total_bytes_allocated)?;
19        writeln!(f, "  Total resets:      {}", self.total_resets)?;
20        writeln!(f, "  Avg alloc size:    {:.1}", self.avg_alloc_size())
21    }
22}