pub struct MemoryReport {
pub before: MemorySnapshot,
pub after: MemorySnapshot,
}Expand description
Memory delta between two snapshots.
Computed from a before and after MemorySnapshot.
Positive deltas mean memory increased; negative means freed.
Fields§
§before: MemorySnapshotSnapshot taken before the operation.
after: MemorySnapshotSnapshot taken after the operation.
Implementations§
Source§impl MemoryReport
impl MemoryReport
Sourcepub const fn new(before: MemorySnapshot, after: MemorySnapshot) -> Self
pub const fn new(before: MemorySnapshot, after: MemorySnapshot) -> Self
Create a report from two snapshots.
Sourcepub fn ram_delta_mb(&self) -> f64
pub fn ram_delta_mb(&self) -> f64
RAM delta in megabytes (positive = increased).
Sourcepub fn vram_delta_mb(&self) -> Option<f64>
pub fn vram_delta_mb(&self) -> Option<f64>
VRAM delta in megabytes (positive = increased).
Returns None if either snapshot lacks VRAM data.
Sourcepub fn print_delta(&self, label: &str)
pub fn print_delta(&self, label: &str)
Print a one-line summary of the delta.
Sourcepub fn print_before_after(&self, label: &str)
pub fn print_before_after(&self, label: &str)
Print a two-line summary showing before → after for both RAM and VRAM.
Trait Implementations§
Source§impl Clone for MemoryReport
impl Clone for MemoryReport
Source§fn clone(&self) -> MemoryReport
fn clone(&self) -> MemoryReport
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 moreAuto Trait Implementations§
impl Freeze for MemoryReport
impl RefUnwindSafe for MemoryReport
impl Send for MemoryReport
impl Sync for MemoryReport
impl Unpin for MemoryReport
impl UnsafeUnpin for MemoryReport
impl UnwindSafe for MemoryReport
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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