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.