AsDisposable
trait · ferroui-dynamic-data · v0.5.0
trait AsDisposable
An item that may be a disposable (item as IDisposable): DisposeMany disposes the items for
which to_disposable gives a disposable, and leaves the others
alone, as upstream disposes the items that implement IDisposable.
Deviation (DEVIATIONS.md, DynamicData): .NET tests the type of an item at run time; Rust has no
such test for a generic item, so the type of the items says whether they are disposable. Every
Rc of a disposable is one (Rc<dyn IDisposable> and Rc<X> for X: IDisposable); another
type implements the trait, or dispose_many_with takes the function that disposes an item.
Members
to_disposable
fn to_disposable(self: &Self) -> Option<Rc<dyn IDisposable>>
The item as a disposable, or None when it is not one.
Trait implementations
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.