pub struct MemoryView { /* private fields */ }Expand description
Memory view - unified read-only access to memory data.
This is the single source of truth for all analysis modules. Reuses MemorySnapshot to avoid duplicate allocation rebuilding.
Implementations§
Source§impl MemoryView
impl MemoryView
Sourcepub fn new(snapshot: MemorySnapshot, events: Vec<MemoryEvent>) -> Self
pub fn new(snapshot: MemorySnapshot, events: Vec<MemoryEvent>) -> Self
Create view from snapshot and events.
Sourcepub fn from_tracker(tracker: &GlobalTracker) -> Self
pub fn from_tracker(tracker: &GlobalTracker) -> Self
Create view from GlobalTracker.
Sourcepub fn from_events(events: Vec<MemoryEvent>) -> Self
pub fn from_events(events: Vec<MemoryEvent>) -> Self
Create view from events directly.
Sourcepub fn allocations(&self) -> Vec<&ActiveAllocation>
pub fn allocations(&self) -> Vec<&ActiveAllocation>
Get all active allocations (from snapshot).
Sourcepub fn get_allocation(&self, ptr: usize) -> Option<&ActiveAllocation>
pub fn get_allocation(&self, ptr: usize) -> Option<&ActiveAllocation>
Get allocation by pointer.
Sourcepub fn events(&self) -> &[MemoryEvent]
pub fn events(&self) -> &[MemoryEvent]
Get all events.
Sourcepub fn snapshot(&self) -> &MemorySnapshot
pub fn snapshot(&self) -> &MemorySnapshot
Get underlying snapshot.
Sourcepub fn filter(&self) -> FilterBuilder<'_>
pub fn filter(&self) -> FilterBuilder<'_>
Create filter builder.
Sourcepub fn total_memory(&self) -> usize
pub fn total_memory(&self) -> usize
Get total memory usage.
Sourcepub fn thread_ids(&self) -> Vec<u64>
pub fn thread_ids(&self) -> Vec<u64>
Get thread IDs.
Trait Implementations§
Source§impl Clone for MemoryView
impl Clone for MemoryView
Source§fn clone(&self) -> MemoryView
fn clone(&self) -> MemoryView
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 MemoryView
impl RefUnwindSafe for MemoryView
impl Send for MemoryView
impl Sync for MemoryView
impl Unpin for MemoryView
impl UnsafeUnpin for MemoryView
impl UnwindSafe for MemoryView
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