pub struct DragSession {
pub kind: DragKind,
pub source: Option<DragSourceId>,
pub press: Point,
pub pointer: Point,
pub ghost_offset: Vec2,
pub hovered: Option<DragTargetId>,
pub payload_type: Option<TypeId>,
pub keyboard: bool,
}Expand description
A snapshot of an in-flight (Dragging/Dropping) session, minus the
payload itself.
Fields§
§kind: DragKindWhere the session came from.
source: Option<DragSourceId>The source that started it; None for DragKind::ExternalFiles.
press: PointThe point the source was pressed at (for an external session, the point the OS drag first entered at).
pointer: PointThe latest pointer position (DragCoordinator::update_pointer).
ghost_offset: Vec2Offset from the pointer to the ghost’s origin
(DragCoordinator::set_ghost_offset); zero until a source sets it.
hovered: Option<DragTargetId>The target currently under the pointer, if any. While Dropping it
is the drop target.
payload_type: Option<TypeId>The payload’s type, while the payload is still held — None once a
target has moved it out with DragCoordinator::take_payload.
keyboard: boolWhether this session was begun by DragCoordinator::lift rather
than DragCoordinator::begin/DragCoordinator::begin_external —
a keyboard session, with no pointer driving it.
DragCoordinator::update_pointer/DragCoordinator::resolve_hover
no-op for one; hover instead advances only through
DragCoordinator::move_to_next_target/
DragCoordinator::move_to_previous_target (see the module
docs).
Implementations§
Source§impl DragSession
impl DragSession
Sourcepub fn ghost_origin(&self) -> Point
pub fn ghost_origin(&self) -> Point
Where the ghost’s origin sits: the pointer plus the ghost offset.
Trait Implementations§
Source§impl Clone for DragSession
impl Clone for DragSession
Source§fn clone(&self) -> DragSession
fn clone(&self) -> DragSession
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DragSession
impl Debug for DragSession
Source§impl PartialEq for DragSession
impl PartialEq for DragSession
impl StructuralPartialEq for DragSession
Auto Trait Implementations§
impl Freeze for DragSession
impl RefUnwindSafe for DragSession
impl Send for DragSession
impl Sync for DragSession
impl Unpin for DragSession
impl UnsafeUnpin for DragSession
impl UnwindSafe for DragSession
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
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>
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>
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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.