FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    IAsyncDataTransfer

    trait · ferroui-base · v0.5.0

    trait IAsyncDataTransfer: IDisposable
    

    Represents an object providing a list of IAsyncDataTransferItem usable by the clipboard.

    When an implementation of this interface is put into the clipboard using IClipboard::set_data_async, it must NOT be disposed by the caller. The system will dispose of it automatically when it becomes unused.

    When an implementation of this interface is returned from the clipboard via IClipboard::try_get_data_async, it MUST be disposed by the caller.

    See DataTransfer for the mutable implementation.

    View source

    Members

    formats

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

    Gets the formats supported by the data transfer.

    Source

    items

    fn items(self: &Self) -> Rc<[Rc<dyn IAsyncDataTransferItem>]>
    

    Gets a list of IAsyncDataTransferItem contained in this object.

    Some platforms (such as Windows and X11) may only support a single data item for all formats except files.

    Items returned by this property must stay valid until the data transfer is disposed.

    Source

    try_formats

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

    Gets the formats supported by the data transfer, 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 clipboard operations use this member instead, so that the failure reaches whoever awaits them. Data transfers whose formats cannot fail keep the default.

    Source

    try_items

    fn try_items(self: &Self) -> Result<Rc<[Rc<dyn IAsyncDataTransferItem>]>, ClipboardError>
    

    Gets the items of the data transfer, or the failure of the platform that provides them. See try_formats.

    Source

    as_data_transfer

    fn as_data_transfer(self: Rc<Self>) -> Option<Rc<dyn IDataTransfer>>
    

    The object as a synchronous data transfer, if it also is one.

    Source

    Trait implementations

    Availability

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