Struct wayland_client::wayland::data_device::WlDataOffer [] [src]

pub struct WlDataOffer {
    // some fields omitted
}

offer to transfer data

A wl_data_offer represents a piece of data offered for transfer by another client (the source client). It is used by the copy-and-paste and drag-and-drop mechanisms. The offer describes the different mime types that the data can be converted to and provides the mechanism for transferring the data directly from the source client.

Methods

impl WlDataOffer

fn accept(&self, serial: u32, mime_type: Option<String>)

accept one of the offered mime types

Indicate that the client can accept the given mime type, or NULL for not accepted.

Used for feedback during drag-and-drop.

fn receive(&self, mime_type: String, fd: RawFd)

request that the data is transferred

To transfer the offered data, the client issues this request and indicates the mime type it wants to receive. The transfer happens through the passed file descriptor (typically created with the pipe system call). The source client writes the data in the mime type representation requested and then closes the file descriptor.

The receiving client reads from the read end of the pipe until EOF and then closes its end, at which point the transfer is complete.

fn destroy(self)

destroy data offer

Destroy the data offer.

Trait Implementations

impl Sync for WlDataOffer

impl Send for WlDataOffer

impl Proxy for WlDataOffer

fn ptr(&self) -> *mut wl_proxy

fn interface() -> *mut wl_interface

fn interface_name() -> &'static str

fn version() -> u32

fn id(&self) -> ProxyId

unsafe fn from_ptr(ptr: *mut wl_proxy) -> WlDataOffer

unsafe fn from_ptr_no_own(ptr: *mut wl_proxy) -> WlDataOffer

fn set_evt_iterator(&mut self, evt: &EventIterator)

impl Debug for WlDataOffer

fn fmt(&self, fmt: &mut Formatter) -> Result<(), Error>

impl Drop for WlDataOffer

fn drop(&mut self)