[][src]Struct smithay_client_toolkit::data_device::DataOffer

pub struct DataOffer { /* fields omitted */ }

A data offer for receiving data though copy/paste or drag and drop

Methods

impl DataOffer[src]

pub fn with_mime_types<F, T>(&self, f: F) -> T where
    F: FnOnce(&[String]) -> T, 
[src]

Access the list of mime types proposed by this offer

pub fn get_available_actions(&self) -> DndAction[src]

Get the list of available actions for this offer

pub fn get_current_action(&self) -> DndAction[src]

Get the currently set final action for this offer

pub fn accept(&self, mime_type: Option<String>)[src]

Accept a mime type for receiving data through this offer

pub fn receive(&self, mime_type: String) -> Result<ReadPipe, ()>[src]

Request to receive the data of a given mime type

You can do this several times, as a reaction to motion of the dnd cursor, or to inspect the data in order to choose your response.

Note that you should not read the contents right way in a blocking way, as you may deadlock your application doing so. At least make sure you flush your events to the server before doing so.

Fails if too many file descriptors were already open and a pipe could not be created.

pub fn set_actions(&self, supported: DndAction, preferred: DndAction)[src]

Notify the send and compositor of the dnd actions you accept

You need to provide the set of supported actions, as well as a single preferred action.

pub fn finish(&self)[src]

Notify that you are finished with this offer, and will no longer be using it

Note that it is a protocol error to finish if no action or mime type was accepted.

Trait Implementations

impl Drop for DataOffer[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.