pub struct EventCx<'a> {
pub window_state: &'a mut WindowState,
pub event: Event,
pub world_transform: Affine,
pub triggered_by: Option<&'a Event>,
pub hit_path: Option<Rc<[ElementId]>>,
pub phase: Phase,
pub target: ElementId,
pub source: ElementId,
pub dispatch: Option<Rc<[Dispatch]>>,
pub source_id: ElementId,
/* private fields */
}Fields§
§window_state: &'a mut WindowState§event: EventAn event transformed to the local coordinate space of the target node.
world_transform: AffineThe transform from window space to the local space of the target element.
triggered_by: Option<&'a Event>The event that caused this synthetic event, if any. Not transformed.
hit_path: Option<Rc<[ElementId]>>All visual IDs under the pointer for pointer events.
phase: PhaseThe event phase for this local event.
target: ElementIdThe target of this event.
source: ElementIdThe visual ID that is the source/origin of this event.
dispatch: Option<Rc<[Dispatch]>>The full dispatch sequence for this event.
source_id: ElementIdThe element that caused the event to be dispatched.
Implementations§
Source§impl<'a> EventCx<'a>
impl<'a> EventCx<'a>
Sourcepub fn stop_immediate_propagation(&mut self)
pub fn stop_immediate_propagation(&mut self)
Stop propagation to other listeners on this target AND to other nodes in the path.
Sourcepub fn prevent_default(&mut self)
pub fn prevent_default(&mut self)
Prevent any default actions for this event.
Sourcepub fn is_default_prevented(&self) -> bool
pub fn is_default_prevented(&self) -> bool
Check if preventDefault() was called on this event.
Sourcepub fn request_pointer_capture(&mut self, pointer_id: PointerId) -> bool
pub fn request_pointer_capture(&mut self, pointer_id: PointerId) -> bool
Request pointer capture for this element.
Sourcepub fn start_drag(
&mut self,
drag_token: DragToken,
config: DragConfig,
use_default_preview: bool,
) -> bool
pub fn start_drag( &mut self, drag_token: DragToken, config: DragConfig, use_default_preview: bool, ) -> bool
Request that this element start tracking a drag.
Should be called in response to PointerCaptureEvent::Gained.
Auto Trait Implementations§
impl<'a> Freeze for EventCx<'a>
impl<'a> !RefUnwindSafe for EventCx<'a>
impl<'a> !Send for EventCx<'a>
impl<'a> !Sync for EventCx<'a>
impl<'a> Unpin for EventCx<'a>
impl<'a> UnsafeUnpin for EventCx<'a>
impl<'a> !UnwindSafe for EventCx<'a>
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more