pub struct MemoryTracker { /* private fields */ }Expand description
Memory usage tracker for monitoring operations
Implementations§
Source§impl MemoryTracker
impl MemoryTracker
Sourcepub fn track_operation<F, R>(
&mut self,
operation: F,
) -> TorshResult<(R, MemoryUsageResult)>where
F: FnOnce() -> TorshResult<R>,
pub fn track_operation<F, R>(
&mut self,
operation: F,
) -> TorshResult<(R, MemoryUsageResult)>where
F: FnOnce() -> TorshResult<R>,
Track memory usage during operation execution
Sourcepub fn memory_growth_rate(&self) -> f64
pub fn memory_growth_rate(&self) -> f64
Get current memory growth rate (bytes per second)
Trait Implementations§
Source§impl Debug for MemoryTracker
impl Debug for MemoryTracker
Auto Trait Implementations§
impl Freeze for MemoryTracker
impl RefUnwindSafe for MemoryTracker
impl Send for MemoryTracker
impl Sync for MemoryTracker
impl Unpin for MemoryTracker
impl UnsafeUnpin for MemoryTracker
impl UnwindSafe for MemoryTracker
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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