Subscription
struct · ferroui-system · v0.5.0
struct Subscription
A subscription or resource released when the guard is dropped.
The guard holds the IDisposable handle an API returned and disposes it
once: when it is dropped, or earlier with dispose. A
subscription meant to last as long as its source is kept with
detach, which gives the handle back without disposing it
(dropping an Rc<dyn IDisposable> keeps the subscription alive).
Members
new
fn new(handle: Rc<dyn IDisposable>) -> Self
The guard of handle.
dispose
fn dispose(self: Self)
Releases the subscription now, the same as dropping the guard.
detach
fn detach(self: Self) -> Rc<dyn IDisposable>
Keeps the subscription for the life of its source and returns its handle, which can still dispose it.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyDropFrom<Rc<dyn IDisposable>>Debug
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.