Skip to main content

ExternalDndBackend

Trait ExternalDndBackend 

Source
pub trait ExternalDndBackend {
    // Required method
    fn attach(
        &mut self,
        parent: ParentHandle,
        window_id: TeksiloWindowId,
        poster: Arc<dyn AppEventPoster>,
    ) -> Box<dyn ExternalDndGuard>;
}
Expand description

Swappable external-drag backend. One backend instance serves the whole app; Self::attach is called once per window.

Required Methods§

Source

fn attach( &mut self, parent: ParentHandle, window_id: TeksiloWindowId, poster: Arc<dyn AppEventPoster>, ) -> Box<dyn ExternalDndGuard>

Register this app as the OS drop target for the window identified by parent (its raw window/display handle). For every phase of a drag over that window the backend MUST post an ExternalDndEventPayload — with window_id_owner set to window_id — through poster.

Returns a guard whose Drop revokes the registration. The guard is held by ExternalDndHandle until the window closes.

Trait Implementations§

Source§

impl ExternalDndBackend for Box<dyn ExternalDndBackend>

Forward through a boxed backend, so ExternalDndHandle::new(default_backend()) (which returns Box<dyn ExternalDndBackend>) type-checks.

Source§

fn attach( &mut self, parent: ParentHandle, window_id: TeksiloWindowId, poster: Arc<dyn AppEventPoster>, ) -> Box<dyn ExternalDndGuard>

Register this app as the OS drop target for the window identified by parent (its raw window/display handle). For every phase of a drag over that window the backend MUST post an ExternalDndEventPayload — with window_id_owner set to window_id — through poster. Read more

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ExternalDndBackend for Box<dyn ExternalDndBackend>

Forward through a boxed backend, so ExternalDndHandle::new(default_backend()) (which returns Box<dyn ExternalDndBackend>) type-checks.

Source§

fn attach( &mut self, parent: ParentHandle, window_id: TeksiloWindowId, poster: Arc<dyn AppEventPoster>, ) -> Box<dyn ExternalDndGuard>

Implementors§