pub struct MemoryExternalDndBackend { /* private fields */ }Expand description
In-memory backend for headless tests. Records the (window_id, poster) of
each attached window so a test can synthesize OS drag phases via
Self::emit, which posts an ExternalDndEventPayload exactly as a real
backend would. Cloneable — clones share the same recording, so a test can
keep a clone after handing one to ExternalDndHandle::new.
Implementations§
Source§impl MemoryExternalDndBackend
impl MemoryExternalDndBackend
Sourcepub fn emit(&self, window_id: TeksiloWindowId, event: ExternalDragEvent) -> bool
pub fn emit(&self, window_id: TeksiloWindowId, event: ExternalDragEvent) -> bool
Synthesize an OS drag phase for window_id, posting it through that
window’s recorded poster. Returns false if the window isn’t attached.
Sourcepub fn attached_windows(&self) -> Vec<TeksiloWindowId>
pub fn attached_windows(&self) -> Vec<TeksiloWindowId>
Window ids currently attached. Test helper.
Sourcepub fn outbound_drags(&self) -> Vec<OutboundDragData>
pub fn outbound_drags(&self) -> Vec<OutboundDragData>
Outbound (app → OS) drags requested via begin_drag, in order. Test
helper for the escalation path.
Trait Implementations§
Source§impl Clone for MemoryExternalDndBackend
impl Clone for MemoryExternalDndBackend
Source§fn clone(&self) -> MemoryExternalDndBackend
fn clone(&self) -> MemoryExternalDndBackend
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for MemoryExternalDndBackend
impl Default for MemoryExternalDndBackend
Source§fn default() -> MemoryExternalDndBackend
fn default() -> MemoryExternalDndBackend
Returns the “default value” for a type. Read more
Source§impl ExternalDndBackend for MemoryExternalDndBackend
impl ExternalDndBackend for MemoryExternalDndBackend
Source§fn attach(
&mut self,
_parent: ParentHandle,
window_id: TeksiloWindowId,
poster: Arc<dyn AppEventPoster>,
) -> Box<dyn ExternalDndGuard>
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 moreAuto Trait Implementations§
impl Freeze for MemoryExternalDndBackend
impl RefUnwindSafe for MemoryExternalDndBackend
impl Send for MemoryExternalDndBackend
impl Sync for MemoryExternalDndBackend
impl Unpin for MemoryExternalDndBackend
impl UnsafeUnpin for MemoryExternalDndBackend
impl UnwindSafe for MemoryExternalDndBackend
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.