pub struct ScopeTracker {
pub active_scopes: RwLock<HashMap<ScopeId, ScopeInfo>>,
pub completed_scopes: Mutex<Vec<ScopeInfo>>,
pub scope_hierarchy: Mutex<ScopeHierarchy>,
pub scope_stack: RwLock<HashMap<String, Vec<ScopeId>>>,
/* private fields */
}Expand description
Core scope tracking functionality
Fields§
§active_scopes: RwLock<HashMap<ScopeId, ScopeInfo>>Active scopes
completed_scopes: Mutex<Vec<ScopeInfo>>Completed scopes for analysis
scope_hierarchy: Mutex<ScopeHierarchy>Scope hierarchy relationships
scope_stack: RwLock<HashMap<String, Vec<ScopeId>>>Current scope stack per thread
Implementations§
Source§impl ScopeTracker
impl ScopeTracker
Sourcepub fn enter_scope(&self, name: String) -> MemScopeResult<ScopeId>
pub fn enter_scope(&self, name: String) -> MemScopeResult<ScopeId>
Enter a new scope
Sourcepub fn exit_scope(&self, scope_id: ScopeId) -> MemScopeResult<()>
pub fn exit_scope(&self, scope_id: ScopeId) -> MemScopeResult<()>
Exit a scope
pub fn associate_variable( &self, variable_name: String, memory_size: usize, ) -> MemScopeResult<()>
pub fn get_scope_analysis(&self) -> MemScopeResult<ScopeAnalysis>
pub fn get_scope_lifecycle_metrics( &self, ) -> MemScopeResult<Vec<ScopeLifecycleMetrics>>
pub fn get_all_scopes(&self) -> Vec<ScopeInfo>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ScopeTracker
impl RefUnwindSafe for ScopeTracker
impl Send for ScopeTracker
impl Sync for ScopeTracker
impl Unpin for ScopeTracker
impl UnsafeUnpin for ScopeTracker
impl UnwindSafe for ScopeTracker
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