Struct wayrs_client::protocol::wl_data_source::WlDataSource
source · pub struct WlDataSource { /* private fields */ }
Expand description
offer to transfer data
The wl_data_source object is the source side of a wl_data_offer. It is created by the source client in a data transfer and provides a way to describe the offered data and a way to respond to requests to transfer the data.
See Event
for the list of possible events.
Implementations§
source§impl WlDataSource
impl WlDataSource
sourcepub fn offer<D>(self, conn: &mut Connection<D>, mime_type: CString)
pub fn offer<D>(self, conn: &mut Connection<D>, mime_type: CString)
add an offered mime type
This request adds a mime type to the set of mime types advertised to targets. Can be called several times to offer multiple types.
Since version 1.
sourcepub fn destroy<D>(self, conn: &mut Connection<D>)
pub fn destroy<D>(self, conn: &mut Connection<D>)
destroy the data source
Destroy the data source.
Since version 1.
sourcepub fn set_actions<D>(self, conn: &mut Connection<D>, dnd_actions: DndAction)
pub fn set_actions<D>(self, conn: &mut Connection<D>, dnd_actions: DndAction)
set the available drag-and-drop actions
Sets the actions that the source side client supports for this operation. This request may trigger wl_data_source.action and wl_data_offer.action events if the compositor needs to change the selected action.
The dnd_actions argument must contain only values expressed in the wl_data_device_manager.dnd_actions enum, otherwise it will result in a protocol error.
This request must be made once only, and can only be made on sources used in drag-and-drop, so it must be performed before wl_data_device.start_drag. Attempting to use the source other than for drag-and-drop will raise a protocol error.
Since version 3.
Trait Implementations§
source§impl Borrow<ObjectId> for WlDataSource
impl Borrow<ObjectId> for WlDataSource
source§impl Clone for WlDataSource
impl Clone for WlDataSource
source§fn clone(&self) -> WlDataSource
fn clone(&self) -> WlDataSource
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for WlDataSource
impl Debug for WlDataSource
source§impl Hash for WlDataSource
impl Hash for WlDataSource
source§impl Ord for WlDataSource
impl Ord for WlDataSource
source§impl PartialEq<ObjectId> for WlDataSource
impl PartialEq<ObjectId> for WlDataSource
source§impl PartialEq<WlDataSource> for ObjectId
impl PartialEq<WlDataSource> for ObjectId
source§fn eq(&self, other: &WlDataSource) -> bool
fn eq(&self, other: &WlDataSource) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq for WlDataSource
impl PartialEq for WlDataSource
source§impl PartialOrd for WlDataSource
impl PartialOrd for WlDataSource
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more