#[repr(C)]pub struct WebEventWheel {
pub x: js_number,
pub y: js_number,
pub delta_x: js_number,
pub delta_y: js_number,
pub buttons: u8,
pub mods: KeyMods,
pub unit: EventWheelUnit,
pub timestamp: JsInstant,
}event and web only.Expand description
๐ซ ๐ A web API Wheel Event.
๐ sys/os/browser/web
๐ฆ size_of::<WebEventWheel>() == 48 bytes / 384 bits
โ๏ธOption<T>
Represents a JavaScript wheel event with browser-native deltas and unit.
This is a raw web-side event carrier.
Use to_kind_timed to normalize it into
EventKindTimed.
ยงNotes
delta_xanddelta_ypreserve the browser-provided wheel deltas.unitpreserves the browser-reported delta unit.buttonspreserves the DOM buttons bitmask as observed during the wheel event.xandyare viewport-relative coordinates.
See also EventWheel, EventWheelUnit.
Fieldsยง
ยงx: js_numberThe X-coordinate of the wheel event relative to the viewport.
y: js_numberThe Y-coordinate of the wheel event relative to the viewport.
delta_x: js_numberThe horizontal wheel delta reported by the browser.
delta_y: js_numberThe vertical wheel delta reported by the browser.
A bitmask of currently held buttons during the wheel event.
mods: KeyModsA bitmask of active keyboard modifiers during the mouse event.
unit: EventWheelUnitThe browser-reported unit associated to delta_x and delta_y.
timestamp: JsInstantThe JavaScript event timestamp.
Implementationsยง
Sourceยงimpl WebEventWheel
impl WebEventWheel
Sourcepub const fn new(
x: js_number,
y: js_number,
delta_x: js_number,
delta_y: js_number,
buttons: u8,
mods: KeyMods,
unit: EventWheelUnit,
timestamp: JsInstant,
) -> Self
pub const fn new( x: js_number, y: js_number, delta_x: js_number, delta_y: js_number, buttons: u8, mods: KeyMods, unit: EventWheelUnit, timestamp: JsInstant, ) -> Self
Returns a new WebEventWheel.
Returns the normalized held-button set.
Returns the raw DOM buttons bitmask.
Sourcepub const fn to_kind_timed(self) -> EventKindTimed
pub const fn to_kind_timed(self) -> EventKindTimed
Converts WebEventWheel to EventKindTimed.
Sourcepub const fn from_event_wheel_timed(
from: Timed<EventWheel, Option<EventTimestamp>>,
) -> WebEventWheel
pub const fn from_event_wheel_timed( from: Timed<EventWheel, Option<EventTimestamp>>, ) -> WebEventWheel
Converts a timed normalized EventWheel back to WebEventWheel.
Trait Implementationsยง
Sourceยงimpl Clone for WebEventWheel
impl Clone for WebEventWheel
Sourceยงfn clone(&self) -> WebEventWheel
fn clone(&self) -> WebEventWheel
1.0.0 (const: unstable) ยท Sourceยงfn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for WebEventWheel
Sourceยงimpl Debug for WebEventWheel
impl Debug for WebEventWheel
Sourceยงimpl From<Timed<EventWheel, Option<EventTimestamp>>> for WebEventWheel
impl From<Timed<EventWheel, Option<EventTimestamp>>> for WebEventWheel
Sourceยงfn from(from: Timed<EventWheel, Option<EventTimestamp>>) -> Self
fn from(from: Timed<EventWheel, Option<EventTimestamp>>) -> Self
Sourceยงimpl From<WebEventWheel> for EventKindTimed
impl From<WebEventWheel> for EventKindTimed
Sourceยงfn from(from: WebEventWheel) -> Self
fn from(from: WebEventWheel) -> Self
Sourceยงimpl PartialEq for WebEventWheel
impl PartialEq for WebEventWheel
Sourceยงfn eq(&self, other: &WebEventWheel) -> bool
fn eq(&self, other: &WebEventWheel) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for WebEventWheel
Auto Trait Implementationsยง
impl Freeze for WebEventWheel
impl RefUnwindSafe for WebEventWheel
impl Send for WebEventWheel
impl Sync for WebEventWheel
impl Unpin for WebEventWheel
impl UnsafeUnpin for WebEventWheel
impl UnwindSafe for WebEventWheel
Blanket Implementationsยง
Sourceยงimpl<T> AnyExt for T
impl<T> AnyExt for T
Sourceยงfn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
fn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
TypeId of Self using a custom hasher.Sourceยงfn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
Sourceยงfn as_any_box(self: Box<Self>) -> Box<dyn Any>where
Self: Sized,
fn as_any_box(self: Box<Self>) -> Box<dyn Any>where
Self: Sized,
alloc only.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
Sourceยงimpl<T> ByteSized for T
impl<T> ByteSized for T
Sourceยงconst BYTE_ALIGN: usize = _
const BYTE_ALIGN: usize = _
Sourceยงfn byte_align(&self) -> usize
fn byte_align(&self) -> usize
Sourceยงfn ptr_size_ratio(&self) -> [usize; 2]
fn ptr_size_ratio(&self) -> [usize; 2]
Sourceยงimpl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Sourceยงimpl<T> MemExt for Twhere
T: ?Sized,
impl<T> MemExt for Twhere
T: ?Sized,
Sourceยงconst NEEDS_DROP: bool = _
const NEEDS_DROP: bool = _
Sourceยงfn mem_align_of<T>() -> usize
fn mem_align_of<T>() -> usize
Sourceยงfn mem_align_of_val(&self) -> usize
fn mem_align_of_val(&self) -> usize
Sourceยงfn mem_size_of<T>() -> usize
fn mem_size_of<T>() -> usize
Sourceยงfn mem_size_of_val(&self) -> usize
fn mem_size_of_val(&self) -> usize
Sourceยงfn mem_needs_drop(&self) -> bool
fn mem_needs_drop(&self) -> bool
true if dropping values of this type matters. Read moreSourceยงfn mem_forget(self)where
Self: Sized,
fn mem_forget(self)where
Self: Sized,
self without running its destructor. Read moreSourceยงfn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
Sourceยงunsafe fn mem_zeroed<T>() -> T
unsafe fn mem_zeroed<T>() -> T
unsafe_layout only.T represented by the all-zero byte-pattern. Read moreSourceยงunsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe_layout only.T represented by the all-zero byte-pattern. Read moreSourceยงfn mem_as_bytes(&self) -> &[u8] โ
fn mem_as_bytes(&self) -> &[u8] โ
unsafe_slice only.