FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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).

    View source

    Members

    new

    fn new(handle: Rc<dyn IDisposable>) -> Self
    

    The guard of handle.

    Source

    dispose

    fn dispose(self: Self)
    

    Releases the subscription now, the same as dropping the guard.

    Source

    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.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • Drop
    • From<Rc<dyn IDisposable>>
    • Debug

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.