smithay_client_toolkit::data_device_manager::data_source

Trait DataSourceHandler

Source
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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§