pub struct Event {
pub type_: String,
pub cancelable: bool,
pub time_stamp: f64,
/* private fields */
}Expand description
The Event fields handlers use. Every event below holds one and
dereferences to it, as the DOM’s event interfaces inherit from Event.
Events are shared (Rc), so a handler’s prevent_default() is seen by
the code that dispatched the event.
Fields§
§type_: Stringtype ("keydown", "beforeinput"…).
cancelable: bool§time_stamp: f64timeStamp, in milliseconds.
Implementations§
Source§impl Event
impl Event
Sourcepub fn prevent_default(&self)
pub fn prevent_default(&self)
preventDefault(): a cancelable event’s default action is not to
happen.
Sourcepub fn default_prevented(&self) -> bool
pub fn default_prevented(&self) -> bool
defaultPrevented.
Sourcepub fn stop_propagation(&self)
pub fn stop_propagation(&self)
stopPropagation().
Sourcepub fn propagation_stopped(&self) -> bool
pub fn propagation_stopped(&self) -> bool
Whether stopPropagation() was called.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Event
impl !RefUnwindSafe for Event
impl !Sync for Event
impl Forget for Event
impl Move for Event
impl Send for Event
impl Unpin for Event
impl UnsafeUnpin for Event
impl UnwindSafe for Event
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