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.
Members
new
fn new(platform_impl: impl PlatformAsyncDataTransferItemImpl + 'static) -> Rc<PlatformAsyncDataTransferItem>
Creates the item for a backend implementation.
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.
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.
contains
fn contains(self: &Self, format: &DataFormat) -> bool
Gets whether the item supports a specific format.
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.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeAsyncDataTransferItemExtensionsClassDefaultsBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyErasedDestructorIntoEitherIAsyncDataTransferItem
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.