FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    CancellationGuard

    struct · ferroui-system · v0.5.0

    struct CancellationGuard
    

    A callback registered with CancellationToken::register or CancellationToken::register_local, removed when the guard is dropped (the place of CancellationTokenRegistration).

    The shape of Subscription: dispose removes it now, detach keeps it for the life of the token. A callback that is running when its guard is dropped finishes (.NET's Dispose waits for it).

    View source

    Members

    dispose

    fn dispose(self: Self)
    

    Removes the callback now, the same as dropping the guard.

    Source

    detach

    fn detach(self: Self)
    

    Keeps the callback for the life of the token.

    Source

    Trait implementations

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

    Availability

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