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§
sourcefn accept_mime(
&mut self,
conn: &Connection,
qh: &QueueHandle<Self>,
source: &WlDataSource,
mime: Option<String>,
)
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.
sourcefn send_request(
&mut self,
conn: &Connection,
qh: &QueueHandle<Self>,
source: &WlDataSource,
mime: String,
fd: WritePipe,
)
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.
sourcefn cancelled(
&mut self,
conn: &Connection,
qh: &QueueHandle<Self>,
source: &WlDataSource,
)
fn cancelled( &mut self, conn: &Connection, qh: &QueueHandle<Self>, source: &WlDataSource, )
The data source is no longer valid Cleanup & destroy this resource
sourcefn dnd_dropped(
&mut self,
conn: &Connection,
qh: &QueueHandle<Self>,
source: &WlDataSource,
)
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
sourcefn dnd_finished(
&mut self,
conn: &Connection,
qh: &QueueHandle<Self>,
source: &WlDataSource,
)
fn dnd_finished( &mut self, conn: &Connection, qh: &QueueHandle<Self>, source: &WlDataSource, )
The drag and drop finished. The data source may be destroyed.
sourcefn action(
&mut self,
conn: &Connection,
qh: &QueueHandle<Self>,
source: &WlDataSource,
action: DndAction,
)
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.