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
[src]

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
[src]

impl Send for WlDataOffer
[src]

impl Proxy for WlDataOffer
[src]

fn ptr(&self) -> *mut wl_proxy

fn interface() -> *mut wl_interface

fn interface_name() -> &'static str

The internal name of this interface, as advertized by the registry if it is a global.

fn version() -> u32

The maximum version of this interface handled by the library.

fn id(&self) -> ProxyId

Get the id of this proxy

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

Creates a proxy from a fresh ptr

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

Creates a proxy from a ptr that is managed elsewhere Read more

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

Set the event iterator associated to this proxy

impl Debug for WlDataOffer
[src]

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

Formats the value using the given formatter.

impl Drop for WlDataOffer
[src]

fn drop(&mut self)

A method called when the value goes out of scope. Read more