pub struct PlatformAsyncDataTransferItem { /* private fields */ }Expand description
The base of the asynchronous data transfer items of the platform backends: caches the formats and only asks for the values of supported formats.
Implementations§
Source§impl PlatformAsyncDataTransferItem
impl PlatformAsyncDataTransferItem
Sourcepub fn new(
platform_impl: impl PlatformAsyncDataTransferItemImpl + 'static,
) -> Rc<PlatformAsyncDataTransferItem>
pub fn new( platform_impl: impl PlatformAsyncDataTransferItemImpl + 'static, ) -> Rc<PlatformAsyncDataTransferItem>
Creates the item for a backend implementation.
Sourcepub fn formats(&self) -> Rc<[DataFormat]>
pub fn formats(&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.
Sourcepub fn try_formats(&self) -> Result<Rc<[DataFormat]>, ClipboardError>
pub fn try_formats(&self) -> Result<Rc<[DataFormat]>, ClipboardError>
Gets the formats supported by this item, or the failure of the backend providing them.
Sourcepub fn contains(&self, format: &DataFormat) -> bool
pub fn contains(&self, format: &DataFormat) -> bool
Gets whether the item supports a specific format.
Sourcepub fn try_get_raw_async(
&self,
format: &DataFormat,
) -> LocalBoxFuture<Result<Option<Rc<dyn Any>>, ClipboardError>>
pub fn try_get_raw_async( &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§
Source§impl IAsyncDataTransferItem for PlatformAsyncDataTransferItem
impl IAsyncDataTransferItem for PlatformAsyncDataTransferItem
Source§fn formats(&self) -> Rc<[DataFormat]>
fn formats(&self) -> Rc<[DataFormat]>
Gets the formats supported by this item.
Source§fn try_formats(&self) -> Result<Rc<[DataFormat]>, ClipboardError>
fn try_formats(&self) -> Result<Rc<[DataFormat]>, ClipboardError>
Gets the formats supported by this item, or the failure of the
platform that provides them. Read more
Source§fn try_get_raw_async(
&self,
format: &DataFormat,
) -> LocalBoxFuture<Result<Option<Rc<dyn Any>>, ClipboardError>>
fn try_get_raw_async( &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. Read moreAuto Trait Implementations§
impl !Freeze for PlatformAsyncDataTransferItem
impl !RefUnwindSafe for PlatformAsyncDataTransferItem
impl !Send for PlatformAsyncDataTransferItem
impl !Sync for PlatformAsyncDataTransferItem
impl !UnwindSafe for PlatformAsyncDataTransferItem
impl Unpin for PlatformAsyncDataTransferItem
impl UnsafeUnpin for PlatformAsyncDataTransferItem
Blanket Implementations§
Source§impl<I> AsyncDataTransferItemExtensions for Iwhere
I: IAsyncDataTransferItem + ?Sized,
impl<I> AsyncDataTransferItemExtensions for Iwhere
I: IAsyncDataTransferItem + ?Sized,
Source§fn contains(&self, format: &DataFormat) -> bool
fn contains(&self, format: &DataFormat) -> bool
Gets whether the item supports a specific format.
Source§fn try_contains(&self, format: &DataFormat) -> Result<bool, ClipboardError>
fn try_contains(&self, format: &DataFormat) -> Result<bool, ClipboardError>
Gets whether the item supports a specific format, or the failure of
the platform that provides the formats of the item.
Source§fn try_get_value_async<T: Clone + 'static>(
&self,
format: &DataFormatOf<T>,
) -> LocalBoxFuture<Result<Option<T>, ClipboardError>>
fn try_get_value_async<T: Clone + 'static>( &self, format: &DataFormatOf<T>, ) -> LocalBoxFuture<Result<Option<T>, ClipboardError>>
Tries to get a value for a given format from the item. The future
resolves to
None if the format is not supported, and to an error
if the platform providing the value fails.Source§fn try_get_text_async(
&self,
) -> LocalBoxFuture<Result<Option<String>, ClipboardError>>
fn try_get_text_async( &self, ) -> LocalBoxFuture<Result<Option<String>, ClipboardError>>
Returns a text, if available, from the item.
Source§fn try_get_bitmap_async(
&self,
) -> LocalBoxFuture<Result<Option<Rc<Bitmap>>, ClipboardError>>
fn try_get_bitmap_async( &self, ) -> LocalBoxFuture<Result<Option<Rc<Bitmap>>, ClipboardError>>
Returns a bitmap, if available, from the item.
Source§fn try_get_file_async(
&self,
) -> LocalBoxFuture<Result<Option<Rc<dyn IStorageItem>>, ClipboardError>>
fn try_get_file_async( &self, ) -> LocalBoxFuture<Result<Option<Rc<dyn IStorageItem>>, ClipboardError>>
Returns a file (or folder), if available, from the item. Read more
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
The static constructor of a type: work done once per thread, after
the properties of the type are registered and before its first
instance exists (class handlers,
affects_render, metadata
overrides). Read more