pub trait DataDeviceHandling {
    // Required methods
    fn set_callback<F: FnMut(WlSeat, DndEvent<'_>, DispatchData<'_>) + 'static>(
        &mut self,
        callback: F
    ) -> Result<(), MissingGlobal>;
    fn with_device<F: FnOnce(&DataDevice)>(
        &self,
        seat: &WlSeat,
        f: F
    ) -> Result<(), MissingGlobal>;
}
Expand description

An interface trait to forward the data device handler capability

You need to implement this trait for your environment struct, by delegating it to its DataDeviceHandler field in order to get the associated methods on your Environment.

Required Methods§

source

fn set_callback<F: FnMut(WlSeat, DndEvent<'_>, DispatchData<'_>) + 'static>( &mut self, callback: F ) -> Result<(), MissingGlobal>

Set the global drag’n’drop callback

Returns an error if the wl_data_device_manager global is missing.

source

fn with_device<F: FnOnce(&DataDevice)>( &self, seat: &WlSeat, f: F ) -> Result<(), MissingGlobal>

Access the data device associated with a seat

Returns an error if the seat is not found (for example if it has since been removed by the server) or if the wl_data_device_manager global is missing.

Implementors§