pub struct SnapEvent { /* private fields */ }Expand description
The SnapEvent class.
SnapEvent
Implementations§
Source§impl SnapEvent
impl SnapEvent
Sourcepub fn snap_target_block(&self) -> Node
pub fn snap_target_block(&self) -> Node
Getter of the snapTargetBlock attribute.
SnapEvent.snapTargetBlock
Source§impl SnapEvent
impl SnapEvent
Sourcepub fn snap_target_inline(&self) -> Node
pub fn snap_target_inline(&self) -> Node
Getter of the snapTargetInline attribute.
SnapEvent.snapTargetInline
Source§impl SnapEvent
impl SnapEvent
Sourcepub fn new_with_event_init_dict(
type_: &JsString,
event_init_dict: &SnapEventInit,
) -> SnapEvent
pub fn new_with_event_init_dict( type_: &JsString, event_init_dict: &SnapEventInit, ) -> SnapEvent
The new SnapEvent(..) constructor, creating a new SnapEvent instance
Methods from Deref<Target = Event>§
Sourcepub fn type_(&self) -> JsString
pub fn type_(&self) -> JsString
Getter of the type attribute.
Event.type
Sourcepub fn target(&self) -> EventTarget
pub fn target(&self) -> EventTarget
Getter of the target attribute.
Event.target
Sourcepub fn src_element(&self) -> EventTarget
pub fn src_element(&self) -> EventTarget
Getter of the srcElement attribute.
Event.srcElement
Sourcepub fn current_target(&self) -> EventTarget
pub fn current_target(&self) -> EventTarget
Getter of the currentTarget attribute.
Event.currentTarget
Sourcepub fn event_phase(&self) -> u16
pub fn event_phase(&self) -> u16
Getter of the eventPhase attribute.
Event.eventPhase
Sourcepub fn cancel_bubble(&self) -> bool
pub fn cancel_bubble(&self) -> bool
Getter of the cancelBubble attribute.
Event.cancelBubble
Sourcepub fn set_cancel_bubble(&mut self, value: bool)
pub fn set_cancel_bubble(&mut self, value: bool)
Setter of the cancelBubble attribute.
Event.cancelBubble
Sourcepub fn bubbles(&self) -> bool
pub fn bubbles(&self) -> bool
Getter of the bubbles attribute.
Event.bubbles
Sourcepub fn cancelable(&self) -> bool
pub fn cancelable(&self) -> bool
Getter of the cancelable attribute.
Event.cancelable
Sourcepub fn return_value(&self) -> bool
pub fn return_value(&self) -> bool
Getter of the returnValue attribute.
Event.returnValue
Sourcepub fn set_return_value(&mut self, value: bool)
pub fn set_return_value(&mut self, value: bool)
Setter of the returnValue attribute.
Event.returnValue
Sourcepub fn default_prevented(&self) -> bool
pub fn default_prevented(&self) -> bool
Getter of the defaultPrevented attribute.
Event.defaultPrevented
Sourcepub fn composed(&self) -> bool
pub fn composed(&self) -> bool
Getter of the composed attribute.
Event.composed
Sourcepub fn is_trusted(&self) -> bool
pub fn is_trusted(&self) -> bool
Getter of the isTrusted attribute.
Event.isTrusted
Sourcepub fn time_stamp(&self) -> Any
pub fn time_stamp(&self) -> Any
Getter of the timeStamp attribute.
Event.timeStamp
Sourcepub fn composed_path(&self) -> TypedArray<EventTarget>
pub fn composed_path(&self) -> TypedArray<EventTarget>
The composedPath method.
Event.composedPath
Sourcepub fn stop_propagation(&self) -> Undefined
pub fn stop_propagation(&self) -> Undefined
The stopPropagation method.
Event.stopPropagation
Sourcepub fn stop_immediate_propagation(&self) -> Undefined
pub fn stop_immediate_propagation(&self) -> Undefined
The stopImmediatePropagation method.
Event.stopImmediatePropagation
Sourcepub fn prevent_default(&self) -> Undefined
pub fn prevent_default(&self) -> Undefined
The preventDefault method.
Event.preventDefault
Sourcepub fn init_event(&self, type_: &JsString) -> Undefined
pub fn init_event(&self, type_: &JsString) -> Undefined
The initEvent method.
Event.initEvent
Sourcepub fn init_event_with_bubbles(
&self,
type_: &JsString,
bubbles: bool,
) -> Undefined
pub fn init_event_with_bubbles( &self, type_: &JsString, bubbles: bool, ) -> Undefined
The initEvent method.
Event.initEvent
Sourcepub fn init_event_with_bubbles_and_cancelable(
&self,
type_: &JsString,
bubbles: bool,
cancelable: bool,
) -> Undefined
pub fn init_event_with_bubbles_and_cancelable( &self, type_: &JsString, bubbles: bool, cancelable: bool, ) -> Undefined
The initEvent method.
Event.initEvent
Methods from Deref<Target = Any>§
Sourcepub fn has_own_property(&self, prop: &str) -> bool
pub fn has_own_property(&self, prop: &str) -> bool
Checks whether a non-inherited property prop exists
Sourcepub fn at<T>(&self, idx: T) -> Val
pub fn at<T>(&self, idx: T) -> Val
Gets the element at index idx. Assumes the underlying js type is indexable
Sourcepub fn to_vec<V>(&self) -> Vec<V>where
V: FromVal,
pub fn to_vec<V>(&self) -> Vec<V>where
V: FromVal,
Converts the underlying js array to a Vec of V
Sourcepub fn call(&self, f: &str, args: &[Val]) -> Val
pub fn call(&self, f: &str, args: &[Val]) -> Val
Calls the method f with args, can return an undefined js value
Sourcepub fn new(&self, args: &[Val]) -> Val
pub fn new(&self, args: &[Val]) -> Val
Calls the object’s constructor with args constructing a new object
Sourcepub fn invoke(&self, args: &[Val]) -> Val
pub fn invoke(&self, args: &[Val]) -> Val
Invokes the function object with args, can return an undefined js value
Sourcepub fn instanceof(&self, v: Val) -> bool
pub fn instanceof(&self, v: Val) -> bool
Checks whether this Val is an instanceof v
pub fn is_number(&self) -> bool
pub fn is_bool(&self) -> bool
pub fn is_string(&self) -> bool
pub fn is_null(&self) -> bool
pub fn is_undefined(&self) -> bool
pub fn is_error(&self) -> bool
pub fn is_function(&self) -> bool
pub fn as_<T>(&self) -> Twhere
T: FromVal,
Trait Implementations§
Source§impl DynCast for SnapEvent
impl DynCast for SnapEvent
Source§fn instanceof(val: &Any) -> bool
fn instanceof(val: &Any) -> bool
val instanceof ThisType.Source§fn unchecked_from_val(v: Any) -> Self
fn unchecked_from_val(v: Any) -> Self
Val into Self.Source§fn unchecked_from_val_ref(v: &Any) -> &Self
fn unchecked_from_val_ref(v: &Any) -> &Self
&Val into &Self.Source§fn unchecked_from_val_mut(v: &mut Any) -> &mut Self
fn unchecked_from_val_mut(v: &mut Any) -> &mut Self
&mut Val into &mut Self.fn has_type<T>(&self) -> boolwhere
T: DynCast,
fn dyn_into<T>(self) -> Result<T, Self>where
T: DynCast,
fn dyn_ref<T>(&self) -> Option<&T>where
T: DynCast,
fn dyn_mut<T>(&mut self) -> Option<&mut T>where
T: DynCast,
fn unchecked_into<T>(self) -> Twhere
T: DynCast,
fn unchecked_ref<T>(&self) -> &Twhere
T: DynCast,
fn unchecked_mut<T>(&mut self) -> &mut Twhere
T: DynCast,
fn is_instance_of<T>(&self) -> boolwhere
T: DynCast,
Source§fn is_type_of(val: &Val) -> bool
fn is_type_of(val: &Val) -> bool
instanceof.