pub struct AllocationInfoAdapter { /* private fields */ }
Expand description
Adapter that provides AllocationInfo interface backed by OptimizedAllocationInfo
This allows existing code to continue working unchanged while benefiting from string interning optimizations under the hood.
Implementations§
Source§impl AllocationInfoAdapter
impl AllocationInfoAdapter
Sourcepub fn new(optimized: OptimizedAllocationInfo) -> Self
pub fn new(optimized: OptimizedAllocationInfo) -> Self
Create a new adapter from an OptimizedAllocationInfo
Sourcepub fn from_allocation(ptr: usize, size: usize) -> Self
pub fn from_allocation(ptr: usize, size: usize) -> Self
Create a new adapter with basic allocation info
Sourcepub fn inner(&self) -> &OptimizedAllocationInfo
pub fn inner(&self) -> &OptimizedAllocationInfo
Get the underlying optimized allocation info
Sourcepub fn inner_mut(&mut self) -> &mut OptimizedAllocationInfo
pub fn inner_mut(&mut self) -> &mut OptimizedAllocationInfo
Get a mutable reference to the underlying optimized allocation info
Sourcepub fn to_allocation_info(&self) -> AllocationInfo
pub fn to_allocation_info(&self) -> AllocationInfo
Convert to the original AllocationInfo format
Sourcepub fn from_allocation_info(info: AllocationInfo) -> Self
pub fn from_allocation_info(info: AllocationInfo) -> Self
Convert from the original AllocationInfo format
pub fn ptr(&self) -> usize
pub fn size(&self) -> usize
pub fn var_name(&self) -> Option<String>
pub fn set_var_name(&mut self, name: Option<String>)
pub fn type_name(&self) -> Option<String>
pub fn set_type_name(&mut self, name: Option<String>)
pub fn scope_name(&self) -> Option<String>
pub fn set_scope_name(&mut self, name: Option<String>)
pub fn timestamp_alloc(&self) -> u64
pub fn timestamp_dealloc(&self) -> Option<u64>
pub fn set_timestamp_dealloc(&mut self, timestamp: Option<u64>)
pub fn thread_id(&self) -> String
pub fn set_thread_id(&mut self, id: String)
pub fn borrow_count(&self) -> usize
pub fn set_borrow_count(&mut self, count: usize)
pub fn stack_trace(&self) -> Option<Vec<String>>
pub fn set_stack_trace(&mut self, trace: Option<Vec<String>>)
pub fn is_leaked(&self) -> bool
pub fn set_is_leaked(&mut self, leaked: bool)
pub fn lifetime_ms(&self) -> Option<u64>
pub fn is_active(&self) -> bool
pub fn mark_deallocated(&mut self)
Trait Implementations§
Source§impl Clone for AllocationInfoAdapter
impl Clone for AllocationInfoAdapter
Source§impl Debug for AllocationInfoAdapter
impl Debug for AllocationInfoAdapter
Source§impl From<AllocationInfo> for AllocationInfoAdapter
impl From<AllocationInfo> for AllocationInfoAdapter
Source§fn from(info: AllocationInfo) -> Self
fn from(info: AllocationInfo) -> Self
Converts to this type from the input type.
Source§impl From<AllocationInfoAdapter> for AllocationInfo
impl From<AllocationInfoAdapter> for AllocationInfo
Source§fn from(adapter: AllocationInfoAdapter) -> Self
fn from(adapter: AllocationInfoAdapter) -> Self
Converts to this type from the input type.
Source§impl From<AllocationInfoAdapter> for OptimizedAllocationInfo
impl From<AllocationInfoAdapter> for OptimizedAllocationInfo
Source§fn from(adapter: AllocationInfoAdapter) -> Self
fn from(adapter: AllocationInfoAdapter) -> Self
Converts to this type from the input type.
Source§impl From<OptimizedAllocationInfo> for AllocationInfoAdapter
impl From<OptimizedAllocationInfo> for AllocationInfoAdapter
Source§fn from(optimized: OptimizedAllocationInfo) -> Self
fn from(optimized: OptimizedAllocationInfo) -> Self
Converts to this type from the input type.
Source§impl PartialEq for AllocationInfoAdapter
impl PartialEq for AllocationInfoAdapter
Auto Trait Implementations§
impl Freeze for AllocationInfoAdapter
impl RefUnwindSafe for AllocationInfoAdapter
impl Send for AllocationInfoAdapter
impl Sync for AllocationInfoAdapter
impl Unpin for AllocationInfoAdapter
impl UnwindSafe for AllocationInfoAdapter
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