FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    PlatformAsyncDataTransferItem

    struct · ferroui-base · v0.5.0

    struct PlatformAsyncDataTransferItem
    

    The base of the asynchronous data transfer items of the platform backends: caches the formats and only asks for the values of supported formats.

    View source

    Members

    new

    fn new(platform_impl: impl PlatformAsyncDataTransferItemImpl + 'static) -> Rc<PlatformAsyncDataTransferItem>
    

    Creates the item for a backend implementation.

    Source

    formats

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

    Gets the formats supported by this item.

    Panics

    Panics if the backend fails to provide them (where the reference throws from the property); try_formats reports the failure instead.

    Source

    try_formats

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

    Gets the formats supported by this item, or the failure of the backend providing them.

    Source

    contains

    fn contains(self: &Self, format: &DataFormat) -> bool
    

    Gets whether the item supports a specific format.

    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 backend fails to provide the formats or the value.

    Source

    Trait implementations

    Availability

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