pub trait DataTransferExtensions: IDataTransfer {
// Provided methods
fn contains(&self, format: &DataFormat) -> bool { ... }
fn get_items(&self, format: &DataFormat) -> DataTransferItems ⓘ { ... }
fn try_get_value<T: Clone + 'static>(
&self,
format: &DataFormatOf<T>,
) -> Option<T> { ... }
fn try_get_values<T: Clone + 'static>(
&self,
format: &DataFormatOf<T>,
) -> Option<Vec<T>> { ... }
fn try_get_text(&self) -> Option<String> { ... }
fn try_get_bitmap(&self) -> Option<Rc<Bitmap>> { ... }
fn try_get_file(&self) -> Option<Rc<dyn IStorageItem>> { ... }
fn try_get_files(&self) -> Option<Vec<Rc<dyn IStorageItem>>> { ... }
}Expand description
Contains extension methods for IDataTransfer.
Provided Methods§
Sourcefn contains(&self, format: &DataFormat) -> bool
fn contains(&self, format: &DataFormat) -> bool
Gets whether the data transfer supports a specific format.
Sourcefn 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.
Some platforms (such as Windows and X11) may only support a single data item for all formats except files.
Sourcefn 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.
If the data transfer contains several items supporting the format, the first matching one will be returned.
Sourcefn 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.
Sourcefn try_get_text(&self) -> Option<String>
fn try_get_text(&self) -> Option<String>
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.
Sourcefn try_get_bitmap(&self) -> Option<Rc<Bitmap>>
fn try_get_bitmap(&self) -> Option<Rc<Bitmap>>
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.
Sourcefn 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.
See DataFormat::file.
Sourcefn 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.
See DataFormat::file.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".