pub struct MemoryManager { /* private fields */ }Expand description
Memory manager for tracking and optimizing memory usage
Implementations§
Source§impl MemoryManager
impl MemoryManager
Sourcepub fn new(options: MemoryOptions) -> Self
pub fn new(options: MemoryOptions) -> Self
Create a new memory manager
Sourcepub fn stats(&self) -> MemoryStats
pub fn stats(&self) -> MemoryStats
Get memory statistics
Sourcepub fn record_allocation(&self, bytes: usize)
pub fn record_allocation(&self, bytes: usize)
Record a memory allocation
Sourcepub fn record_cache_hit(&self)
pub fn record_cache_hit(&self)
Record a cache hit
Sourcepub fn record_cache_miss(&self)
pub fn record_cache_miss(&self)
Record a cache miss
Sourcepub fn cache(&self) -> Option<&ObjectCache>
pub fn cache(&self) -> Option<&ObjectCache>
Get the object cache
Auto Trait Implementations§
impl Freeze for MemoryManager
impl RefUnwindSafe for MemoryManager
impl Send for MemoryManager
impl Sync for MemoryManager
impl Unpin for MemoryManager
impl UnwindSafe for MemoryManager
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more