FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    SingleAssignmentDisposableValue

    struct · ferroui-reactive · v0.5.0

    struct SingleAssignmentDisposableValue
    

    A slot for a disposable that can be assigned once (SingleAssignmentDisposableValue). A disposable assigned after the slot was disposed is disposed at once; a second assignment panics, where upstream throws InvalidOperationException.

    View source

    Members

    new

    const fn new() -> Self
    

    Source

    is_disposed

    fn is_disposed(self: &Self) -> bool
    

    Whether the slot has been disposed.

    Source

    disposable

    fn disposable(self: &Self) -> Option<Rc<dyn IDisposable>>
    

    The assigned disposable, if any (none once the slot is disposed).

    Source

    set_disposable

    fn set_disposable(self: &Self, value: Option<Rc<dyn IDisposable>>)
    

    Assigns the disposable. Panics when one was assigned already.

    Source

    dispose

    fn dispose(self: &Self)
    

    Disposes the slot and the disposable it holds.

    Source

    Trait implementations

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

    Availability

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