pub trait DragHost {
// Required methods
fn drag(&self, pointer_id: PointerId) -> Option<&DragSession>;
fn drag_mut(&mut self, pointer_id: PointerId) -> Option<&mut DragSession>;
fn cancel_drag(&mut self, pointer_id: PointerId);
fn any_drag_session(
&self,
predicate: impl FnMut(&DragSession) -> bool,
) -> bool;
fn find_drag_pointer_id(
&self,
predicate: impl FnMut(&DragSession) -> bool,
) -> Option<PointerId>;
fn cancel_drag_sessions(
&mut self,
predicate: impl FnMut(&DragSession) -> bool,
) -> Vec<PointerId>;
fn begin_drag_with_kind<T: Any>(
&mut self,
pointer_id: PointerId,
kind: DragKindId,
source_window: AppWindowId,
start: Point,
payload: T,
);
fn begin_cross_window_drag_with_kind<T: Any>(
&mut self,
pointer_id: PointerId,
kind: DragKindId,
source_window: AppWindowId,
start: Point,
payload: T,
);
}Required Methods§
Sourcefn drag(&self, pointer_id: PointerId) -> Option<&DragSession>
fn drag(&self, pointer_id: PointerId) -> Option<&DragSession>
Returns the drag session associated with the pointer, if any.
Sourcefn drag_mut(&mut self, pointer_id: PointerId) -> Option<&mut DragSession>
fn drag_mut(&mut self, pointer_id: PointerId) -> Option<&mut DragSession>
Returns a mutable drag session associated with the pointer, if any.
Sourcefn cancel_drag(&mut self, pointer_id: PointerId)
fn cancel_drag(&mut self, pointer_id: PointerId)
Cancels a drag session associated with the pointer, if any.
Sourcefn any_drag_session(&self, predicate: impl FnMut(&DragSession) -> bool) -> bool
fn any_drag_session(&self, predicate: impl FnMut(&DragSession) -> bool) -> bool
Returns true if any active drag session matches the predicate.
Sourcefn find_drag_pointer_id(
&self,
predicate: impl FnMut(&DragSession) -> bool,
) -> Option<PointerId>
fn find_drag_pointer_id( &self, predicate: impl FnMut(&DragSession) -> bool, ) -> Option<PointerId>
Finds the first pointer id whose drag session matches the predicate.
Sourcefn cancel_drag_sessions(
&mut self,
predicate: impl FnMut(&DragSession) -> bool,
) -> Vec<PointerId>
fn cancel_drag_sessions( &mut self, predicate: impl FnMut(&DragSession) -> bool, ) -> Vec<PointerId>
Cancels all drag sessions matching the predicate and returns their pointer ids.
Sourcefn begin_drag_with_kind<T: Any>(
&mut self,
pointer_id: PointerId,
kind: DragKindId,
source_window: AppWindowId,
start: Point,
payload: T,
)
fn begin_drag_with_kind<T: Any>( &mut self, pointer_id: PointerId, kind: DragKindId, source_window: AppWindowId, start: Point, payload: T, )
Begins a drag session with a typed payload.
Sourcefn begin_cross_window_drag_with_kind<T: Any>(
&mut self,
pointer_id: PointerId,
kind: DragKindId,
source_window: AppWindowId,
start: Point,
payload: T,
)
fn begin_cross_window_drag_with_kind<T: Any>( &mut self, pointer_id: PointerId, kind: DragKindId, source_window: AppWindowId, start: Point, payload: T, )
Begins a cross-window drag session with a typed payload.
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.