pub struct ThreadRegistry { /* private fields */ }Expand description
Thread Registry - manages thread metadata
Implementations§
Source§impl ThreadRegistry
impl ThreadRegistry
pub fn next_id(&self) -> MemScopeResult<u64>
Sourcepub fn register_current_thread(&self) -> MemScopeResult<u64>
pub fn register_current_thread(&self) -> MemScopeResult<u64>
Register the current thread
Sourcepub fn get_thread_info(&self, hash: u64) -> MemScopeResult<Option<ThreadInfo>>
pub fn get_thread_info(&self, hash: u64) -> MemScopeResult<Option<ThreadInfo>>
Get thread info by hash
Sourcepub fn record_allocation(&self, hash: u64, size: usize) -> MemScopeResult<()>
pub fn record_allocation(&self, hash: u64, size: usize) -> MemScopeResult<()>
Record an allocation for a thread
Sourcepub fn update_peak_memory(
&self,
hash: u64,
current_memory: usize,
) -> MemScopeResult<()>
pub fn update_peak_memory( &self, hash: u64, current_memory: usize, ) -> MemScopeResult<()>
Update peak memory for a thread
Sourcepub fn mark_thread_inactive(&self, hash: u64) -> MemScopeResult<()>
pub fn mark_thread_inactive(&self, hash: u64) -> MemScopeResult<()>
Mark a thread as inactive
Sourcepub fn get_all_threads(&self) -> MemScopeResult<Vec<ThreadInfo>>
pub fn get_all_threads(&self) -> MemScopeResult<Vec<ThreadInfo>>
Get all threads
Sourcepub fn get_active_threads(&self) -> MemScopeResult<Vec<ThreadInfo>>
pub fn get_active_threads(&self) -> MemScopeResult<Vec<ThreadInfo>>
Get active threads only
Sourcepub fn len(&self) -> MemScopeResult<usize>
pub fn len(&self) -> MemScopeResult<usize>
Get the number of registered threads
Sourcepub fn is_empty(&self) -> MemScopeResult<bool>
pub fn is_empty(&self) -> MemScopeResult<bool>
Check if the registry is empty
Trait Implementations§
Source§impl Debug for ThreadRegistry
impl Debug for ThreadRegistry
Auto Trait Implementations§
impl Freeze for ThreadRegistry
impl RefUnwindSafe for ThreadRegistry
impl Send for ThreadRegistry
impl Sync for ThreadRegistry
impl Unpin for ThreadRegistry
impl UnsafeUnpin for ThreadRegistry
impl UnwindSafe for ThreadRegistry
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