pub trait DataSourceHandler: Sized {
    // Required methods
    fn accept_mime(
        &mut self,
        conn: &Connection,
        qh: &QueueHandle<Self>,
        source: &WlDataSource,
        mime: Option<String>
    );
    fn send_request(
        &mut self,
        conn: &Connection,
        qh: &QueueHandle<Self>,
        source: &WlDataSource,
        mime: String,
        fd: WritePipe
    );
    fn cancelled(
        &mut self,
        conn: &Connection,
        qh: &QueueHandle<Self>,
        source: &WlDataSource
    );
    fn dnd_dropped(
        &mut self,
        conn: &Connection,
        qh: &QueueHandle<Self>,
        source: &WlDataSource
    );
    fn dnd_finished(
        &mut self,
        conn: &Connection,
        qh: &QueueHandle<Self>,
        source: &WlDataSource
    );
    fn action(
        &mut self,
        conn: &Connection,
        qh: &QueueHandle<Self>,
        source: &WlDataSource,
        action: DndAction
    );
}
Expand description

Handler trait for DataSource events.

The functions defined in this trait are called as DataSource events are received from the compositor.

Required Methods§

source

fn accept_mime( &mut self, conn: &Connection, qh: &QueueHandle<Self>, source: &WlDataSource, mime: Option<String> )

This may be called multiple times, once for each accepted mime type from the destination, if any.

source

fn send_request( &mut self, conn: &Connection, qh: &QueueHandle<Self>, source: &WlDataSource, mime: String, fd: WritePipe )

The client has requested the data for this source to be sent. Send the data, then close the fd.

source

fn cancelled( &mut self, conn: &Connection, qh: &QueueHandle<Self>, source: &WlDataSource )

The data source is no longer valid Cleanup & destroy this resource

source

fn dnd_dropped( &mut self, conn: &Connection, qh: &QueueHandle<Self>, source: &WlDataSource )

A drop was performed. The data source will be used and should not be destroyed yet

source

fn dnd_finished( &mut self, conn: &Connection, qh: &QueueHandle<Self>, source: &WlDataSource )

The drag and drop finished. The data source may be destroyed.

source

fn action( &mut self, conn: &Connection, qh: &QueueHandle<Self>, source: &WlDataSource, action: DndAction )

An action was selected by the compositor.

Object Safety§

This trait is not object safe.

Implementors§