pub trait DataTransferSend: DataTransfer + Send {
// Required method
fn data_for_type(&self, type_: &dyn TransferType) -> Option<SendData>;
}Expand description
Trait for sending data via a data transfer.
See ActiveEventLoop::start_drag for where
this is used. To build an implementation of this trait dynamically in a cross-platform way, use
DataTransferSendBuilder.
Required Methods§
Sourcefn data_for_type(&self, type_: &dyn TransferType) -> Option<SendData>
fn data_for_type(&self, type_: &dyn TransferType) -> Option<SendData>
Get the data for the specified type, or None if this value does not supply the given data
type.
Implementations§
Source§impl dyn DataTransferSend + '_
impl dyn DataTransferSend + '_
Sourcepub fn cast_ref<T: DataTransferSend>(&self) -> Option<&T>
pub fn cast_ref<T: DataTransferSend>(&self) -> Option<&T>
Downcast to the backend concrete type.
Returns None if the object was not from that backend.
Sourcepub fn cast_mut<T: DataTransferSend>(&mut self) -> Option<&mut T>
pub fn cast_mut<T: DataTransferSend>(&mut self) -> Option<&mut T>
Mutable downcast to the backend concrete type.
Returns None if the object was not from that backend.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".