pub struct PlatformDataTransfer { /* private fields */ }Expand description
The base of the synchronous data transfers of the platform backends: caches the formats and the items.
Implementations§
Source§impl PlatformDataTransfer
impl PlatformDataTransfer
Sourcepub fn new(
platform_impl: impl PlatformDataTransferImpl + 'static,
) -> Rc<PlatformDataTransfer>
pub fn new( platform_impl: impl PlatformDataTransferImpl + 'static, ) -> Rc<PlatformDataTransfer>
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<PlatformDataTransferItem>]>
pub fn items(&self) -> Rc<[Rc<PlatformDataTransferItem>]>
Sourcepub fn try_items(
&self,
) -> Result<Rc<[Rc<PlatformDataTransferItem>]>, ClipboardError>
pub fn try_items( &self, ) -> Result<Rc<[Rc<PlatformDataTransferItem>]>, 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 PlatformDataTransfer
impl IAsyncDataTransfer for PlatformDataTransfer
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.
Source§impl IDataTransfer for PlatformDataTransfer
impl IDataTransfer for PlatformDataTransfer
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 IDataTransferItem>]>
fn items(&self) -> Rc<[Rc<dyn IDataTransferItem>]>
Gets a list of
IDataTransferItem contained in this object. Read moreSource§fn as_async_data_transfer(self: Rc<Self>) -> Option<Rc<dyn IAsyncDataTransfer>>
fn as_async_data_transfer(self: Rc<Self>) -> Option<Rc<dyn IAsyncDataTransfer>>
The object as an asynchronous data transfer, if it also is one.
Source§impl IDisposable for PlatformDataTransfer
impl IDisposable for PlatformDataTransfer
Auto Trait Implementations§
impl !Freeze for PlatformDataTransfer
impl !RefUnwindSafe for PlatformDataTransfer
impl !Send for PlatformDataTransfer
impl !Sync for PlatformDataTransfer
impl !UnwindSafe for PlatformDataTransfer
impl Unpin for PlatformDataTransfer
impl UnsafeUnpin for PlatformDataTransfer
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 moreSource§impl<I> DataTransferExtensions for Iwhere
I: IDataTransfer + ?Sized,
impl<I> DataTransferExtensions for Iwhere
I: IDataTransfer + ?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) -> DataTransferItems ⓘ
fn get_items(&self, format: &DataFormat) -> DataTransferItems ⓘ
Gets the list of
IDataTransferItem contained in the data
transfer, filtered by a given format. Read moreSource§fn try_get_value<T: Clone + 'static>(
&self,
format: &DataFormatOf<T>,
) -> Option<T>
fn try_get_value<T: Clone + 'static>( &self, format: &DataFormatOf<T>, ) -> Option<T>
Tries to get a value for a given format from the data transfer.
Returns
None if the format is not supported. Read moreSource§fn try_get_values<T: Clone + 'static>(
&self,
format: &DataFormatOf<T>,
) -> Option<Vec<T>>
fn try_get_values<T: Clone + 'static>( &self, format: &DataFormatOf<T>, ) -> Option<Vec<T>>
Tries to get multiple values for a given format from the data
transfer. Returns
None if the format is not supported.Source§fn try_get_text(&self) -> Option<String>
fn try_get_text(&self) -> Option<String>
Returns a text, if available, from the data transfer. Read more
Source§fn try_get_bitmap(&self) -> Option<Rc<Bitmap>>
fn try_get_bitmap(&self) -> Option<Rc<Bitmap>>
Returns a bitmap, if available, from the data transfer. Read more
Source§fn try_get_file(&self) -> Option<Rc<dyn IStorageItem>>
fn try_get_file(&self) -> Option<Rc<dyn IStorageItem>>
Returns a file (or folder), if available, from the data transfer. Read more
Source§fn try_get_files(&self) -> Option<Vec<Rc<dyn IStorageItem>>>
fn try_get_files(&self) -> Option<Vec<Rc<dyn IStorageItem>>>
Returns the files (or folders), if available, from the data
transfer. Read more