pub struct MemoryStats {
pub strings_acquired: usize,
pub strings_released: usize,
pub total_string_capacity: usize,
pub peak_memory_usage: usize,
}
Expand description
内存使用统计
Fields§
§strings_acquired: usize
§strings_released: usize
§total_string_capacity: usize
§peak_memory_usage: usize
Implementations§
Source§impl MemoryStats
impl MemoryStats
Sourcepub fn pool_hit_rate(&self) -> f64
pub fn pool_hit_rate(&self) -> f64
计算池效率(命中率)
Sourcepub fn update_peak_usage(&mut self, current_usage: usize)
pub fn update_peak_usage(&mut self, current_usage: usize)
更新峰值内存使用
Trait Implementations§
Source§impl Clone for MemoryStats
impl Clone for MemoryStats
Source§fn clone(&self) -> MemoryStats
fn clone(&self) -> MemoryStats
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 MemoryStats
impl Debug for MemoryStats
Source§impl Default for MemoryStats
impl Default for MemoryStats
Source§fn default() -> MemoryStats
fn default() -> MemoryStats
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MemoryStats
impl RefUnwindSafe for MemoryStats
impl Send for MemoryStats
impl Sync for MemoryStats
impl Unpin for MemoryStats
impl UnwindSafe for MemoryStats
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