Skip to main content

DataTransferSend

Trait DataTransferSend 

Source
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§

Source

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 + '_

Source

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.

Source

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.

Source

pub fn cast<T: DataTransferSend>(self: Box<Self>) -> Result<Box<T>, Box<Self>>

Owned downcast to the backend concrete type.

Returns Err with self 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".

Implementors§

Source§

impl<T> DataTransferSend for DataTransferSendBuilder<T>
where T: Debug + Send + 'static,