pub struct PlatformAsyncDataTransfer { /* private fields */ }Expand description
The base of the asynchronous data transfers of the platform backends: caches the formats and the items.
Implementations§
Source§impl PlatformAsyncDataTransfer
impl PlatformAsyncDataTransfer
Sourcepub fn new(
platform_impl: impl PlatformAsyncDataTransferImpl + 'static,
) -> Rc<PlatformAsyncDataTransfer>
pub fn new( platform_impl: impl PlatformAsyncDataTransferImpl + 'static, ) -> Rc<PlatformAsyncDataTransfer>
Creates the data transfer for a backend implementation.
Sourcepub fn formats(&self) -> Rc<[DataFormat]>
pub fn formats(&self) -> Rc<[DataFormat]>
Gets the formats supported by the data transfer.
§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 the data transfer, or the failure of the backend providing them.
Sourcepub fn are_formats_initialized(&self) -> bool
pub fn are_formats_initialized(&self) -> bool
Whether the formats have been provided by the backend.
Sourcepub fn items(&self) -> Rc<[Rc<dyn IAsyncDataTransferItem>]>
pub fn items(&self) -> Rc<[Rc<dyn IAsyncDataTransferItem>]>
Sourcepub fn try_items(
&self,
) -> Result<Rc<[Rc<dyn IAsyncDataTransferItem>]>, ClipboardError>
pub fn try_items( &self, ) -> Result<Rc<[Rc<dyn IAsyncDataTransferItem>]>, ClipboardError>
Gets the items of the data transfer, or the failure of the backend providing them.
Sourcepub fn are_items_initialized(&self) -> bool
pub fn are_items_initialized(&self) -> bool
Whether the items have been provided by the backend.
Trait Implementations§
Source§impl IAsyncDataTransfer for PlatformAsyncDataTransfer
impl IAsyncDataTransfer for PlatformAsyncDataTransfer
Source§fn formats(&self) -> Rc<[DataFormat]>
fn formats(&self) -> Rc<[DataFormat]>
Gets the formats supported by the data transfer.
Source§fn items(&self) -> Rc<[Rc<dyn IAsyncDataTransferItem>]>
fn items(&self) -> Rc<[Rc<dyn IAsyncDataTransferItem>]>
Gets a list of
IAsyncDataTransferItem contained in this object. Read moreSource§fn try_formats(&self) -> Result<Rc<[DataFormat]>, ClipboardError>
fn try_formats(&self) -> Result<Rc<[DataFormat]>, ClipboardError>
Gets the formats supported by the data transfer, or the failure of
the platform that provides them. Read more
Source§fn try_items(
&self,
) -> Result<Rc<[Rc<dyn IAsyncDataTransferItem>]>, ClipboardError>
fn try_items( &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§fn as_data_transfer(self: Rc<Self>) -> Option<Rc<dyn IDataTransfer>>
fn as_data_transfer(self: Rc<Self>) -> Option<Rc<dyn IDataTransfer>>
The object as a synchronous data transfer, if it also is one.
Auto Trait Implementations§
impl !Freeze for PlatformAsyncDataTransfer
impl !RefUnwindSafe for PlatformAsyncDataTransfer
impl !Send for PlatformAsyncDataTransfer
impl !Sync for PlatformAsyncDataTransfer
impl !UnwindSafe for PlatformAsyncDataTransfer
impl Unpin for PlatformAsyncDataTransfer
impl UnsafeUnpin for PlatformAsyncDataTransfer
Blanket Implementations§
Source§impl<I> AsyncDataTransferExtensions for Iwhere
I: IAsyncDataTransfer + ?Sized,
impl<I> AsyncDataTransferExtensions for Iwhere
I: IAsyncDataTransfer + ?Sized,
Source§fn contains(&self, format: &DataFormat) -> bool
fn contains(&self, format: &DataFormat) -> bool
Gets whether the data transfer supports a specific format.
Source§fn get_items(&self, format: &DataFormat) -> AsyncDataTransferItems ⓘ
fn get_items(&self, format: &DataFormat) -> AsyncDataTransferItems ⓘ
Gets the list of
IAsyncDataTransferItem contained in the data
transfer, filtered by a given format. Read moreSource§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 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. Read moreSource§fn try_get_values_async<T: Clone + 'static>(
&self,
format: &DataFormatOf<T>,
) -> LocalBoxFuture<Result<Option<Vec<T>>, ClipboardError>>
fn try_get_values_async<T: Clone + 'static>( &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.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 data transfer. Read more
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 data transfer. Read more
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 data transfer. Read more
Source§fn try_get_files_async(
&self,
) -> LocalBoxFuture<Result<Option<Vec<Rc<dyn IStorageItem>>>, ClipboardError>>
fn try_get_files_async( &self, ) -> LocalBoxFuture<Result<Option<Vec<Rc<dyn IStorageItem>>>, ClipboardError>>
Returns the files (or folders), if available, from the data
transfer. 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