FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    IAsyncDataTransferItem

    trait · ferroui-base · v0.5.0

    trait IAsyncDataTransferItem
    

    Represent an item inside a IAsyncDataTransfer. An item may support several formats and can return the value of a given format on demand.

    See DataTransferItem for the mutable implementation.

    View source

    Members

    formats

    fn formats(self: &Self) -> Rc<[DataFormat]>
    

    Gets the formats supported by this item.

    Source

    try_formats

    fn try_formats(self: &Self) -> Result<Rc<[DataFormat]>, ClipboardError>
    

    Gets the formats supported by this item, or the failure of the platform that provides them.

    formats has no way to report a failure (where the reference throws from the property, it panics); the asynchronous operations reading an item use this member instead, so that the failure reaches whoever awaits them. Items whose formats cannot fail keep the default.

    Source

    try_get_raw_async

    fn try_get_raw_async(self: &Self, format: &DataFormat) -> LocalBoxFuture<Result<Option<Rc<dyn Any>>, ClipboardError>>
    

    Tries to get a value for a given format. The future resolves to None if the format is not supported, and to an error if the platform providing the value fails.

    Implementations of this method are expected to return a value matching the exact data type of the underlying DataFormatOf.

    To retrieve a typed value, use AsyncDataTransferItemExtensions::try_get_value_async.

    Source

    Trait implementations

    Availability

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