FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    AsAsyncDisposable

    trait · ferroui-dynamic-data · v0.5.0

    trait AsAsyncDisposable
    

    An item that may be disposable, at once or by a task: AsyncDisposeMany disposes the items for which to_item_disposal gives a disposal, and leaves the others alone, as upstream disposes the items that implement IDisposable or IAsyncDisposable.

    Deviation (DEVIATIONS.md, DynamicData): .NET tests the type of an item at run time, and prefers IDisposable when an item implements both. Rust has no such test for a generic item, so the type of the items says how they are disposed: an Rc of an IAsyncDisposable is disposed by its task, an Rc<dyn IDisposable> at once. Another type implements the trait, or async_dispose_many_with takes the function that tells how an item is disposed.

    View source

    Members

    to_item_disposal

    fn to_item_disposal(self: &Self) -> Option<ItemDisposal>
    

    How the item is disposed, or None when it is not disposable.

    Source

    Trait implementations

    Availability

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