pub struct RcManager { /* private fields */ }Expand description
Manages reference counting within a scope.
The RcManager tracks all live references and their counts,
applies elision hints, and collects statistics.
Implementations§
Source§impl RcManager
impl RcManager
Sourcepub fn with_analysis(analysis: RcElisionAnalysis) -> Self
pub fn with_analysis(analysis: RcElisionAnalysis) -> Self
Create a new RC manager with elision analysis.
Sourcepub fn schedule_dec(&mut self, var: String)
pub fn schedule_dec(&mut self, var: String)
Schedule a decrement for later (batch processing).
Sourcepub fn flush_pending(&mut self)
pub fn flush_pending(&mut self)
Process all pending decrements.
Sourcepub fn can_mutate_inplace(&self, var: &str) -> bool
pub fn can_mutate_inplace(&self, var: &str) -> bool
Check if a variable can be mutated in-place.
Sourcepub fn record_inplace_mutation(&mut self)
pub fn record_inplace_mutation(&mut self)
Record an in-place mutation.
Sourcepub fn record_cow(&mut self)
pub fn record_cow(&mut self)
Record a copy-on-write operation.
Sourcepub fn analysis(&self) -> &RcElisionAnalysis
pub fn analysis(&self) -> &RcElisionAnalysis
Get the elision analysis.
Sourcepub fn set_enabled(&mut self, enabled: bool)
pub fn set_enabled(&mut self, enabled: bool)
Enable or disable RC tracking.
Sourcepub fn set_max_rc_threshold(&mut self, threshold: u32)
pub fn set_max_rc_threshold(&mut self, threshold: u32)
Set the maximum RC threshold.
Sourcepub fn max_rc_threshold(&self) -> u32
pub fn max_rc_threshold(&self) -> u32
Get the max RC threshold.
Sourcepub fn reset_stats(&mut self)
pub fn reset_stats(&mut self)
Reset statistics.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RcManager
impl RefUnwindSafe for RcManager
impl Send for RcManager
impl Sync for RcManager
impl Unpin for RcManager
impl UnsafeUnpin for RcManager
impl UnwindSafe for RcManager
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