#[repr(transparent)]pub struct Event {
pub obj: JsValue,
}Expand description
The Event class.
This API requires the following crate features to be activated: Event
Fields§
§obj: JsValueImplementations§
Source§impl Event
impl Event
Source§impl Event
impl Event
Sourcepub fn target(&self) -> Option<EventTarget>
pub fn target(&self) -> Option<EventTarget>
Getter for the target field of this object.
This API requires the following crate features to be activated: Event, EventTarget
Source§impl Event
impl Event
Sourcepub fn current_target(&self) -> Option<EventTarget>
pub fn current_target(&self) -> Option<EventTarget>
Getter for the currentTarget field of this object.
This API requires the following crate features to be activated: Event, EventTarget
Source§impl Event
impl Event
Sourcepub fn event_phase(&self) -> u16
pub fn event_phase(&self) -> u16
Getter for the eventPhase field of this object.
This API requires the following crate features to be activated: Event
Source§impl Event
impl Event
Source§impl Event
impl Event
Sourcepub fn cancelable(&self) -> bool
pub fn cancelable(&self) -> bool
Getter for the cancelable field of this object.
This API requires the following crate features to be activated: Event
Source§impl Event
impl Event
Sourcepub fn default_prevented(&self) -> bool
pub fn default_prevented(&self) -> bool
Getter for the defaultPrevented field of this object.
This API requires the following crate features to be activated: Event
Source§impl Event
impl Event
Source§impl Event
impl Event
Sourcepub fn is_trusted(&self) -> bool
pub fn is_trusted(&self) -> bool
Getter for the isTrusted field of this object.
This API requires the following crate features to be activated: Event
Source§impl Event
impl Event
Sourcepub fn time_stamp(&self) -> f64
pub fn time_stamp(&self) -> f64
Getter for the timeStamp field of this object.
This API requires the following crate features to be activated: Event
Source§impl Event
impl Event
Sourcepub fn cancel_bubble(&self) -> bool
pub fn cancel_bubble(&self) -> bool
Getter for the cancelBubble field of this object.
This API requires the following crate features to be activated: Event
Source§impl Event
impl Event
Sourcepub fn set_cancel_bubble(&self, value: bool)
pub fn set_cancel_bubble(&self, value: bool)
Setter for the cancelBubble field of this object.
This API requires the following crate features to be activated: Event
Source§impl Event
impl Event
Source§impl Event
impl Event
Sourcepub fn composed_path(&self) -> Array
pub fn composed_path(&self) -> Array
The composedPath() method.
This API requires the following crate features to be activated: Event
Source§impl Event
impl Event
Sourcepub fn init_event(&self, type_: &str)
pub fn init_event(&self, type_: &str)
The initEvent() method.
This API requires the following crate features to be activated: Event
Source§impl Event
impl Event
Sourcepub fn init_event_with_bubbles(&self, type_: &str, bubbles: bool)
pub fn init_event_with_bubbles(&self, type_: &str, bubbles: bool)
The initEvent() method.
This API requires the following crate features to be activated: Event
Source§impl Event
impl Event
Sourcepub fn init_event_with_bubbles_and_cancelable(
&self,
type_: &str,
bubbles: bool,
cancelable: bool,
)
pub fn init_event_with_bubbles_and_cancelable( &self, type_: &str, bubbles: bool, cancelable: bool, )
The initEvent() method.
This API requires the following crate features to be activated: Event
Source§impl Event
impl Event
Sourcepub fn prevent_default(&self)
pub fn prevent_default(&self)
The preventDefault() method.
This API requires the following crate features to be activated: Event
Source§impl Event
impl Event
Sourcepub fn stop_immediate_propagation(&self)
pub fn stop_immediate_propagation(&self)
The stopImmediatePropagation() method.
This API requires the following crate features to be activated: Event
Source§impl Event
impl Event
Sourcepub fn stop_propagation(&self)
pub fn stop_propagation(&self)
The stopPropagation() method.
This API requires the following crate features to be activated: Event
Source§impl Event
impl Event
Sourcepub const NONE: u16 = 0u16
pub const NONE: u16 = 0u16
The Event.NONE const.
This API requires the following crate features to be activated: Event
Sourcepub const CAPTURING_PHASE: u16 = 1u16
pub const CAPTURING_PHASE: u16 = 1u16
The Event.CAPTURING_PHASE const.
This API requires the following crate features to be activated: Event
Sourcepub const AT_TARGET: u16 = 2u16
pub const AT_TARGET: u16 = 2u16
The Event.AT_TARGET const.
This API requires the following crate features to be activated: Event
Sourcepub const BUBBLING_PHASE: u16 = 3u16
pub const BUBBLING_PHASE: u16 = 3u16
The Event.BUBBLING_PHASE const.
This API requires the following crate features to be activated: Event
Methods from Deref<Target = Object>§
Sourcepub fn constructor(&self) -> Function
pub fn constructor(&self) -> Function
The constructor property returns a reference to the Object constructor
function that created the instance object.
Sourcepub fn has_own_property(&self, property: &JsValue) -> bool
pub fn has_own_property(&self, property: &JsValue) -> bool
The hasOwnProperty() method returns a boolean indicating whether the
object has the specified property as its own property (as opposed to
inheriting it).
Sourcepub fn is_prototype_of(&self, value: &JsValue) -> bool
pub fn is_prototype_of(&self, value: &JsValue) -> bool
The isPrototypeOf() method checks if an object exists in another
object’s prototype chain.
Sourcepub fn property_is_enumerable(&self, property: &JsValue) -> bool
pub fn property_is_enumerable(&self, property: &JsValue) -> bool
The propertyIsEnumerable() method returns a Boolean indicating
whether the specified property is enumerable.
Sourcepub fn to_locale_string(&self) -> JsString
pub fn to_locale_string(&self) -> JsString
The toLocaleString() method returns a string representing the object.
This method is meant to be overridden by derived objects for
locale-specific purposes.
Sourcepub fn to_string(&self) -> JsString
pub fn to_string(&self) -> JsString
The toString() method returns a string representing the object.
Methods from Deref<Target = JsValue>§
pub const NULL: JsValue
pub const UNDEFINED: JsValue
pub const TRUE: JsValue
pub const FALSE: JsValue
Sourcepub fn id(&self) -> u64
pub fn id(&self) -> u64
Get the heap ID for this value.
This is used internally for encoding values to send to JS.
Sourcepub fn unchecked_into_f64(&self) -> f64
pub fn unchecked_into_f64(&self) -> f64
Returns the value as f64 without type checking. Used by serde-wasm-bindgen for numeric conversions.
Sourcepub fn has_type<T>(&self) -> boolwhere
T: JsCast,
pub fn has_type<T>(&self) -> boolwhere
T: JsCast,
Check if this value is an instance of a specific JS type.
Sourcepub fn checked_div(&self, rhs: &JsValue) -> JsValue
pub fn checked_div(&self, rhs: &JsValue) -> JsValue
Checked division.
Sourcepub fn unsigned_shr(&self, rhs: &JsValue) -> u32
pub fn unsigned_shr(&self, rhs: &JsValue) -> u32
Unsigned right shift.
Sourcepub fn is_function(&self) -> bool
pub fn is_function(&self) -> bool
Check if this value is a function.
Sourcepub fn is_undefined(&self) -> bool
pub fn is_undefined(&self) -> bool
Check if this value is undefined.
Sourcepub fn js_in(&self, obj: &JsValue) -> bool
pub fn js_in(&self, obj: &JsValue) -> bool
Check if this value has a property with the given name.
Sourcepub fn as_debug_string(&self) -> String
pub fn as_debug_string(&self) -> String
Get a debug string representation of the value.
Trait Implementations§
Source§impl AsRef<Event> for AnimationEvent
impl AsRef<Event> for AnimationEvent
Source§impl AsRef<Event> for BeforeUnloadEvent
impl AsRef<Event> for BeforeUnloadEvent
Source§impl AsRef<Event> for ClipboardEvent
impl AsRef<Event> for ClipboardEvent
Source§impl AsRef<Event> for CloseEvent
impl AsRef<Event> for CloseEvent
Source§impl AsRef<Event> for CompositionEvent
impl AsRef<Event> for CompositionEvent
Source§impl AsRef<Event> for CustomEvent
impl AsRef<Event> for CustomEvent
Source§impl AsRef<Event> for ErrorEvent
impl AsRef<Event> for ErrorEvent
Source§impl AsRef<Event> for ExtendableEvent
impl AsRef<Event> for ExtendableEvent
Source§impl AsRef<Event> for ExtendableMessageEvent
impl AsRef<Event> for ExtendableMessageEvent
Source§impl AsRef<Event> for FetchEvent
impl AsRef<Event> for FetchEvent
Source§impl AsRef<Event> for FocusEvent
impl AsRef<Event> for FocusEvent
Source§impl AsRef<Event> for HashChangeEvent
impl AsRef<Event> for HashChangeEvent
Source§impl AsRef<Event> for IdbVersionChangeEvent
impl AsRef<Event> for IdbVersionChangeEvent
Source§impl AsRef<Event> for InputEvent
impl AsRef<Event> for InputEvent
Source§impl AsRef<Event> for KeyboardEvent
impl AsRef<Event> for KeyboardEvent
Source§impl AsRef<Event> for MediaQueryListEvent
impl AsRef<Event> for MediaQueryListEvent
Source§impl AsRef<Event> for MessageEvent
impl AsRef<Event> for MessageEvent
Source§impl AsRef<Event> for MouseEvent
impl AsRef<Event> for MouseEvent
Source§impl AsRef<Event> for PageTransitionEvent
impl AsRef<Event> for PageTransitionEvent
Source§impl AsRef<Event> for PointerEvent
impl AsRef<Event> for PointerEvent
Source§impl AsRef<Event> for PopStateEvent
impl AsRef<Event> for PopStateEvent
Source§impl AsRef<Event> for ProgressEvent
impl AsRef<Event> for ProgressEvent
Source§impl AsRef<Event> for PromiseRejectionEvent
impl AsRef<Event> for PromiseRejectionEvent
Source§impl AsRef<Event> for SecurityPolicyViolationEvent
impl AsRef<Event> for SecurityPolicyViolationEvent
Source§impl AsRef<Event> for StorageEvent
impl AsRef<Event> for StorageEvent
Source§impl AsRef<Event> for SubmitEvent
impl AsRef<Event> for SubmitEvent
Source§impl AsRef<Event> for ToggleEvent
impl AsRef<Event> for ToggleEvent
Source§impl AsRef<Event> for TouchEvent
impl AsRef<Event> for TouchEvent
Source§impl AsRef<Event> for TransitionEvent
impl AsRef<Event> for TransitionEvent
Source§impl AsRef<Event> for WebGlContextEvent
impl AsRef<Event> for WebGlContextEvent
Source§impl AsRef<Event> for WheelEvent
impl AsRef<Event> for WheelEvent
Source§impl BatchableResult for Event
impl BatchableResult for Event
Source§impl BinaryDecode for Event
impl BinaryDecode for Event
fn decode(decoder: &mut DecodedData<'_>) -> Result<Self, DecodeError>
Source§impl BinaryEncode for &Event
impl BinaryEncode for &Event
fn encode(self, encoder: &mut EncodedData)
Source§impl BinaryEncode for Event
impl BinaryEncode for Event
fn encode(self, encoder: &mut EncodedData)
Source§impl EncodeTypeDef for Event
impl EncodeTypeDef for Event
Source§fn encode_type_def(buf: &mut Vec<u8>)
fn encode_type_def(buf: &mut Vec<u8>)
Source§impl From<&AnimationEvent> for Event
impl From<&AnimationEvent> for Event
Source§fn from(val: &AnimationEvent) -> Event
fn from(val: &AnimationEvent) -> Event
Source§impl From<&BeforeUnloadEvent> for Event
impl From<&BeforeUnloadEvent> for Event
Source§fn from(val: &BeforeUnloadEvent) -> Event
fn from(val: &BeforeUnloadEvent) -> Event
Source§impl From<&ClipboardEvent> for Event
impl From<&ClipboardEvent> for Event
Source§fn from(val: &ClipboardEvent) -> Event
fn from(val: &ClipboardEvent) -> Event
Source§impl From<&CloseEvent> for Event
impl From<&CloseEvent> for Event
Source§fn from(val: &CloseEvent) -> Event
fn from(val: &CloseEvent) -> Event
Source§impl From<&CompositionEvent> for Event
impl From<&CompositionEvent> for Event
Source§fn from(val: &CompositionEvent) -> Event
fn from(val: &CompositionEvent) -> Event
Source§impl From<&CustomEvent> for Event
impl From<&CustomEvent> for Event
Source§fn from(val: &CustomEvent) -> Event
fn from(val: &CustomEvent) -> Event
Source§impl From<&ErrorEvent> for Event
impl From<&ErrorEvent> for Event
Source§fn from(val: &ErrorEvent) -> Event
fn from(val: &ErrorEvent) -> Event
Source§impl From<&ExtendableEvent> for Event
impl From<&ExtendableEvent> for Event
Source§fn from(val: &ExtendableEvent) -> Event
fn from(val: &ExtendableEvent) -> Event
Source§impl From<&ExtendableMessageEvent> for Event
impl From<&ExtendableMessageEvent> for Event
Source§fn from(val: &ExtendableMessageEvent) -> Event
fn from(val: &ExtendableMessageEvent) -> Event
Source§impl From<&FetchEvent> for Event
impl From<&FetchEvent> for Event
Source§fn from(val: &FetchEvent) -> Event
fn from(val: &FetchEvent) -> Event
Source§impl From<&FocusEvent> for Event
impl From<&FocusEvent> for Event
Source§fn from(val: &FocusEvent) -> Event
fn from(val: &FocusEvent) -> Event
Source§impl From<&HashChangeEvent> for Event
impl From<&HashChangeEvent> for Event
Source§fn from(val: &HashChangeEvent) -> Event
fn from(val: &HashChangeEvent) -> Event
Source§impl From<&IdbVersionChangeEvent> for Event
impl From<&IdbVersionChangeEvent> for Event
Source§fn from(val: &IdbVersionChangeEvent) -> Event
fn from(val: &IdbVersionChangeEvent) -> Event
Source§impl From<&InputEvent> for Event
impl From<&InputEvent> for Event
Source§fn from(val: &InputEvent) -> Event
fn from(val: &InputEvent) -> Event
Source§impl From<&KeyboardEvent> for Event
impl From<&KeyboardEvent> for Event
Source§fn from(val: &KeyboardEvent) -> Event
fn from(val: &KeyboardEvent) -> Event
Source§impl From<&MediaQueryListEvent> for Event
impl From<&MediaQueryListEvent> for Event
Source§fn from(val: &MediaQueryListEvent) -> Event
fn from(val: &MediaQueryListEvent) -> Event
Source§impl From<&MessageEvent> for Event
impl From<&MessageEvent> for Event
Source§fn from(val: &MessageEvent) -> Event
fn from(val: &MessageEvent) -> Event
Source§impl From<&MouseEvent> for Event
impl From<&MouseEvent> for Event
Source§fn from(val: &MouseEvent) -> Event
fn from(val: &MouseEvent) -> Event
Source§impl From<&PageTransitionEvent> for Event
impl From<&PageTransitionEvent> for Event
Source§fn from(val: &PageTransitionEvent) -> Event
fn from(val: &PageTransitionEvent) -> Event
Source§impl From<&PointerEvent> for Event
impl From<&PointerEvent> for Event
Source§fn from(val: &PointerEvent) -> Event
fn from(val: &PointerEvent) -> Event
Source§impl From<&PopStateEvent> for Event
impl From<&PopStateEvent> for Event
Source§fn from(val: &PopStateEvent) -> Event
fn from(val: &PopStateEvent) -> Event
Source§impl From<&ProgressEvent> for Event
impl From<&ProgressEvent> for Event
Source§fn from(val: &ProgressEvent) -> Event
fn from(val: &ProgressEvent) -> Event
Source§impl From<&PromiseRejectionEvent> for Event
impl From<&PromiseRejectionEvent> for Event
Source§fn from(val: &PromiseRejectionEvent) -> Event
fn from(val: &PromiseRejectionEvent) -> Event
Source§impl From<&SecurityPolicyViolationEvent> for Event
impl From<&SecurityPolicyViolationEvent> for Event
Source§fn from(val: &SecurityPolicyViolationEvent) -> Event
fn from(val: &SecurityPolicyViolationEvent) -> Event
Source§impl From<&StorageEvent> for Event
impl From<&StorageEvent> for Event
Source§fn from(val: &StorageEvent) -> Event
fn from(val: &StorageEvent) -> Event
Source§impl From<&SubmitEvent> for Event
impl From<&SubmitEvent> for Event
Source§fn from(val: &SubmitEvent) -> Event
fn from(val: &SubmitEvent) -> Event
Source§impl From<&ToggleEvent> for Event
impl From<&ToggleEvent> for Event
Source§fn from(val: &ToggleEvent) -> Event
fn from(val: &ToggleEvent) -> Event
Source§impl From<&TouchEvent> for Event
impl From<&TouchEvent> for Event
Source§fn from(val: &TouchEvent) -> Event
fn from(val: &TouchEvent) -> Event
Source§impl From<&TransitionEvent> for Event
impl From<&TransitionEvent> for Event
Source§fn from(val: &TransitionEvent) -> Event
fn from(val: &TransitionEvent) -> Event
Source§impl From<&WebGlContextEvent> for Event
impl From<&WebGlContextEvent> for Event
Source§fn from(val: &WebGlContextEvent) -> Event
fn from(val: &WebGlContextEvent) -> Event
Source§impl From<&WheelEvent> for Event
impl From<&WheelEvent> for Event
Source§fn from(val: &WheelEvent) -> Event
fn from(val: &WheelEvent) -> Event
Source§impl From<AnimationEvent> for Event
impl From<AnimationEvent> for Event
Source§fn from(val: AnimationEvent) -> Event
fn from(val: AnimationEvent) -> Event
Source§impl From<BeforeUnloadEvent> for Event
impl From<BeforeUnloadEvent> for Event
Source§fn from(val: BeforeUnloadEvent) -> Event
fn from(val: BeforeUnloadEvent) -> Event
Source§impl From<ClipboardEvent> for Event
impl From<ClipboardEvent> for Event
Source§fn from(val: ClipboardEvent) -> Event
fn from(val: ClipboardEvent) -> Event
Source§impl From<CloseEvent> for Event
impl From<CloseEvent> for Event
Source§fn from(val: CloseEvent) -> Event
fn from(val: CloseEvent) -> Event
Source§impl From<CompositionEvent> for Event
impl From<CompositionEvent> for Event
Source§fn from(val: CompositionEvent) -> Event
fn from(val: CompositionEvent) -> Event
Source§impl From<CustomEvent> for Event
impl From<CustomEvent> for Event
Source§fn from(val: CustomEvent) -> Event
fn from(val: CustomEvent) -> Event
Source§impl From<ErrorEvent> for Event
impl From<ErrorEvent> for Event
Source§fn from(val: ErrorEvent) -> Event
fn from(val: ErrorEvent) -> Event
Source§impl From<ExtendableEvent> for Event
impl From<ExtendableEvent> for Event
Source§fn from(val: ExtendableEvent) -> Event
fn from(val: ExtendableEvent) -> Event
Source§impl From<ExtendableMessageEvent> for Event
impl From<ExtendableMessageEvent> for Event
Source§fn from(val: ExtendableMessageEvent) -> Event
fn from(val: ExtendableMessageEvent) -> Event
Source§impl From<FetchEvent> for Event
impl From<FetchEvent> for Event
Source§fn from(val: FetchEvent) -> Event
fn from(val: FetchEvent) -> Event
Source§impl From<FocusEvent> for Event
impl From<FocusEvent> for Event
Source§fn from(val: FocusEvent) -> Event
fn from(val: FocusEvent) -> Event
Source§impl From<HashChangeEvent> for Event
impl From<HashChangeEvent> for Event
Source§fn from(val: HashChangeEvent) -> Event
fn from(val: HashChangeEvent) -> Event
Source§impl From<IdbVersionChangeEvent> for Event
impl From<IdbVersionChangeEvent> for Event
Source§fn from(val: IdbVersionChangeEvent) -> Event
fn from(val: IdbVersionChangeEvent) -> Event
Source§impl From<InputEvent> for Event
impl From<InputEvent> for Event
Source§fn from(val: InputEvent) -> Event
fn from(val: InputEvent) -> Event
Source§impl From<KeyboardEvent> for Event
impl From<KeyboardEvent> for Event
Source§fn from(val: KeyboardEvent) -> Event
fn from(val: KeyboardEvent) -> Event
Source§impl From<MediaQueryListEvent> for Event
impl From<MediaQueryListEvent> for Event
Source§fn from(val: MediaQueryListEvent) -> Event
fn from(val: MediaQueryListEvent) -> Event
Source§impl From<MessageEvent> for Event
impl From<MessageEvent> for Event
Source§fn from(val: MessageEvent) -> Event
fn from(val: MessageEvent) -> Event
Source§impl From<MouseEvent> for Event
impl From<MouseEvent> for Event
Source§fn from(val: MouseEvent) -> Event
fn from(val: MouseEvent) -> Event
Source§impl From<PageTransitionEvent> for Event
impl From<PageTransitionEvent> for Event
Source§fn from(val: PageTransitionEvent) -> Event
fn from(val: PageTransitionEvent) -> Event
Source§impl From<PointerEvent> for Event
impl From<PointerEvent> for Event
Source§fn from(val: PointerEvent) -> Event
fn from(val: PointerEvent) -> Event
Source§impl From<PopStateEvent> for Event
impl From<PopStateEvent> for Event
Source§fn from(val: PopStateEvent) -> Event
fn from(val: PopStateEvent) -> Event
Source§impl From<ProgressEvent> for Event
impl From<ProgressEvent> for Event
Source§fn from(val: ProgressEvent) -> Event
fn from(val: ProgressEvent) -> Event
Source§impl From<PromiseRejectionEvent> for Event
impl From<PromiseRejectionEvent> for Event
Source§fn from(val: PromiseRejectionEvent) -> Event
fn from(val: PromiseRejectionEvent) -> Event
Source§impl From<SecurityPolicyViolationEvent> for Event
impl From<SecurityPolicyViolationEvent> for Event
Source§fn from(val: SecurityPolicyViolationEvent) -> Event
fn from(val: SecurityPolicyViolationEvent) -> Event
Source§impl From<StorageEvent> for Event
impl From<StorageEvent> for Event
Source§fn from(val: StorageEvent) -> Event
fn from(val: StorageEvent) -> Event
Source§impl From<SubmitEvent> for Event
impl From<SubmitEvent> for Event
Source§fn from(val: SubmitEvent) -> Event
fn from(val: SubmitEvent) -> Event
Source§impl From<ToggleEvent> for Event
impl From<ToggleEvent> for Event
Source§fn from(val: ToggleEvent) -> Event
fn from(val: ToggleEvent) -> Event
Source§impl From<TouchEvent> for Event
impl From<TouchEvent> for Event
Source§fn from(val: TouchEvent) -> Event
fn from(val: TouchEvent) -> Event
Source§impl From<TransitionEvent> for Event
impl From<TransitionEvent> for Event
Source§fn from(val: TransitionEvent) -> Event
fn from(val: TransitionEvent) -> Event
Source§impl From<WebGlContextEvent> for Event
impl From<WebGlContextEvent> for Event
Source§fn from(val: WebGlContextEvent) -> Event
fn from(val: WebGlContextEvent) -> Event
Source§impl From<WheelEvent> for Event
impl From<WheelEvent> for Event
Source§fn from(val: WheelEvent) -> Event
fn from(val: WheelEvent) -> Event
Source§impl JsCast for Event
impl JsCast for Event
Source§fn instanceof(__val: &JsValue) -> bool
fn instanceof(__val: &JsValue) -> bool
Source§fn unchecked_from_js(val: JsValue) -> Self
fn unchecked_from_js(val: JsValue) -> Self
Source§fn unchecked_from_js_ref(val: &JsValue) -> &Self
fn unchecked_from_js_ref(val: &JsValue) -> &Self
Source§fn is_type_of(val: &JsValue) -> bool
fn is_type_of(val: &JsValue) -> bool
JsValue provided
is a value of this type. Read moreSource§fn has_type<T>(&self) -> boolwhere
T: JsCast,
fn has_type<T>(&self) -> boolwhere
T: JsCast,
T. Read moreSource§fn dyn_into<T>(self) -> Result<T, Self>where
T: JsCast,
fn dyn_into<T>(self) -> Result<T, Self>where
T: JsCast,
Source§fn dyn_ref<T>(&self) -> Option<&T>where
T: JsCast,
fn dyn_ref<T>(&self) -> Option<&T>where
T: JsCast,
Source§fn is_instance_of<T>(&self) -> boolwhere
T: JsCast,
fn is_instance_of<T>(&self) -> boolwhere
T: JsCast,
T. Read more