pub struct DisposableTracker { /* private fields */ }Expand description
A tracker that can be manually disposed before it’s dropped.
Unlike Tracker, DisposableTracker provides a dispose() method to
explicitly clean up all subscriptions. This is useful for long-lived
objects that need to clear subscriptions mid-lifecycle.
DisposableTracker is Clone - all clones share the same internal state via Rc
Implementations§
Source§impl DisposableTracker
impl DisposableTracker
Sourcepub fn tracker(&self) -> &Tracker
pub fn tracker(&self) -> &Tracker
Returns the underlying Tracker for use with subscribe methods.
Sourcepub fn dispose(&mut self)
pub fn dispose(&mut self)
Manually disposes all tracked subscriptions.
After calling this, the tracker is still valid and can track new subscriptions, but all previous subscriptions are cleaned up.
Sourcepub fn subscription_count(&self) -> usize
pub fn subscription_count(&self) -> usize
Returns the number of active subscriptions tracked.
Trait Implementations§
Source§impl Clone for DisposableTracker
impl Clone for DisposableTracker
Source§fn clone(&self) -> DisposableTracker
fn clone(&self) -> DisposableTracker
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more