FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    CancellationTokenSource

    struct · ferroui-system · v0.5.0

    struct CancellationTokenSource
    

    Signals to one or more CancellationTokens that they should be canceled.

    A source is a CancellationToken that can be canceled (CancellationToken::new): its token is a clone of it, and canceling either cancels both.

    View source

    Deprecated since 0.5.0. use CancellationToken::new(), which can be canceled, and its clones in the place of token()

    Members

    new

    fn new() -> Self
    

    Source

    token

    fn token(self: &Self) -> CancellationToken
    

    The token observing this source.

    Source

    is_cancellation_requested

    fn is_cancellation_requested(self: &Self) -> bool
    

    Source

    cancel

    fn cancel(self: &Self)
    

    Requests cancellation and runs the registered callbacks on the calling thread. Subsequent calls do nothing.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • Clone
    • Default
    • From<CancellationTokenSource>

    Availability

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