Trait RequestDispatch

Source
pub trait RequestDispatch<Ctx> {
    type Error;
    type OfferFut<'a>: Future<Output = Result<(), Self::Error>> + 'a
       where Ctx: 'a;
    type DestroyFut<'a>: Future<Output = Result<(), Self::Error>> + 'a
       where Ctx: 'a;
    type SetActionsFut<'a>: Future<Output = Result<(), Self::Error>> + 'a
       where Ctx: 'a;

    // Required methods
    fn offer<'a>(
        ctx: &'a mut Ctx,
        object_id: u32,
        mime_type: Str<'a>,
    ) -> Self::OfferFut<'a>;
    fn destroy<'a>(ctx: &'a mut Ctx, object_id: u32) -> Self::DestroyFut<'a>;
    fn set_actions<'a>(
        ctx: &'a mut Ctx,
        object_id: u32,
        dnd_actions: DndAction,
    ) -> Self::SetActionsFut<'a>;
}

Required Associated Types§

Source

type Error

Source

type OfferFut<'a>: Future<Output = Result<(), Self::Error>> + 'a where Ctx: 'a

Type of future returned by offer

Source

type DestroyFut<'a>: Future<Output = Result<(), Self::Error>> + 'a where Ctx: 'a

Type of future returned by destroy

Source

type SetActionsFut<'a>: Future<Output = Result<(), Self::Error>> + 'a where Ctx: 'a

Type of future returned by set_actions

Required Methods§

Source

fn offer<'a>( ctx: &'a mut Ctx, object_id: u32, mime_type: Str<'a>, ) -> Self::OfferFut<'a>

add an offered mime type

This request adds a mime type to the set of mime types advertised to targets. Can be called several times to offer multiple types.

Source

fn destroy<'a>(ctx: &'a mut Ctx, object_id: u32) -> Self::DestroyFut<'a>

destroy the data source

Destroy the data source.

Source

fn set_actions<'a>( ctx: &'a mut Ctx, object_id: u32, dnd_actions: DndAction, ) -> Self::SetActionsFut<'a>

set the available drag-and-drop actions

Sets the actions that the source side client supports for this operation. This request may trigger wl_data_source.action and wl_data_offer.action events if the compositor needs to change the selected action.

The dnd_actions argument must contain only values expressed in the wl_data_device_manager.dnd_actions enum, otherwise it will result in a protocol error.

This request must be made once only, and can only be made on sources used in drag-and-drop, so it must be performed before wl_data_device.start_drag. Attempting to use the source other than for drag-and-drop will raise a protocol error.

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§