pub struct PointerEvent {
pub id: PointerId,
pub kind: PointerKind,
pub event: PointerEventKind,
pub position: Vec2,
pub pressure: f32,
pub modifiers: Modifiers,
pub consumed: Rc<Cell<bool>>,
}Fields§
§id: PointerId§kind: PointerKind§event: PointerEventKind§position: Vec2§pressure: f32§modifiers: Modifiers§consumed: Rc<Cell<bool>>Shared consumed state — every clone of this event points to the same
Cell. Calling consume() on any clone marks it consumed for all clones.
Implementations§
Source§impl PointerEvent
impl PointerEvent
pub fn new( id: PointerId, kind: PointerKind, event: PointerEventKind, position: Vec2, pressure: f32, modifiers: Modifiers, ) -> Self
Sourcepub fn consume(&self)
pub fn consume(&self)
Mark this event as consumed. Once consumed, subsequent handlers in the
same pass should skip processing it (equivalent to Compose’s
PointerInputChange.consume()).
Sourcepub fn is_consumed(&self) -> bool
pub fn is_consumed(&self) -> bool
Returns true if consume() was called on this event or any clone of it.
Trait Implementations§
Source§impl Clone for PointerEvent
impl Clone for PointerEvent
Source§fn clone(&self) -> PointerEvent
fn clone(&self) -> PointerEvent
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 moreAuto Trait Implementations§
impl !RefUnwindSafe for PointerEvent
impl !Send for PointerEvent
impl !Sync for PointerEvent
impl !UnwindSafe for PointerEvent
impl Freeze for PointerEvent
impl Unpin for PointerEvent
impl UnsafeUnpin for PointerEvent
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