AsyncDataTransferExtensions
trait · ferroui-base · v0.5.0
trait AsyncDataTransferExtensions: IAsyncDataTransfer
Contains extension methods for IAsyncDataTransfer.
Members
containsget_itemstry_get_value_asynctry_get_values_asynctry_get_text_asynctry_get_bitmap_asynctry_get_file_asynctry_get_files_async
contains
fn contains(self: &Self, format: &DataFormat) -> bool
Gets whether the data transfer supports a specific format.
get_items
fn get_items(self: &Self, format: &DataFormat) -> AsyncDataTransferItems
Gets the list of IAsyncDataTransferItem contained in the data
transfer, filtered by a given format.
Some platforms (such as Windows and X11) may only support a single data item for all formats except files.
try_get_value_async
fn try_get_value_async<T: Clone + 'static>(self: &Self, format: &DataFormatOf<T>) -> LocalBoxFuture<Result<Option<T>, ClipboardError>>
Tries to get a value for a given format from the data transfer. The
future resolves to None if the format is not supported, and to an
error if the platform providing the items, their formats or the
value fails.
If the data transfer contains several items supporting the format, the first matching one will be returned.
try_get_values_async
fn try_get_values_async<T: Clone + 'static>(self: &Self, format: &DataFormatOf<T>) -> LocalBoxFuture<Result<Option<Vec<T>>, ClipboardError>>
Tries to get multiple values for a given format from the data
transfer. The future resolves to None if the format is not
supported, and to an error as soon as the platform providing the
items, their formats or one of the values fails.
try_get_text_async
fn try_get_text_async(self: &Self) -> LocalBoxFuture<Result<Option<String>, ClipboardError>>
Returns a text, if available, from the data transfer.
If the data transfer contains several items supporting
DataFormat::text, the first matching one will be returned.
try_get_bitmap_async
fn try_get_bitmap_async(self: &Self) -> LocalBoxFuture<Result<Option<Rc<Bitmap>>, ClipboardError>>
Returns a bitmap, if available, from the data transfer.
If the data transfer contains several items supporting
DataFormat::bitmap, the first matching one will be returned.
try_get_file_async
fn try_get_file_async(self: &Self) -> LocalBoxFuture<Result<Option<Rc<dyn IStorageItem>>, ClipboardError>>
Returns a file (or folder), if available, from the data transfer.
See DataFormat::file.
try_get_files_async
fn try_get_files_async(self: &Self) -> LocalBoxFuture<Result<Option<Vec<Rc<dyn IStorageItem>>>, ClipboardError>>
Returns the files (or folders), if available, from the data transfer.
See DataFormat::file.
Trait implementations
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.