pub struct SerializedPointInteraction {
Show 14 fields pub alt_key: bool, pub button: i16, pub buttons: u16, pub client_x: i32, pub client_y: i32, pub ctrl_key: bool, pub meta_key: bool, pub offset_x: i32, pub offset_y: i32, pub page_x: i32, pub page_y: i32, pub screen_x: i32, pub screen_y: i32, pub shift_key: bool,
}
Available on crate feature html only.

Fields§

§alt_key: bool§button: i16

The button number that was pressed (if applicable) when the mouse event was fired.

§buttons: u16

Indicates which buttons are pressed on the mouse (or other input device) when a mouse event is triggered.

Each button that can be pressed is represented by a given number (see below). If more than one button is pressed, the button values are added together to produce a new number. For example, if the secondary (2) and auxiliary (4) buttons are pressed simultaneously, the value is 6 (i.e., 2 + 4).

  • 1: Primary button (usually the left button)
  • 2: Secondary button (usually the right button)
  • 4: Auxiliary button (usually the mouse wheel button or middle button)
  • 8: 4th button (typically the “Browser Back” button)
  • 16 : 5th button (typically the “Browser Forward” button)
§client_x: i32

The horizontal coordinate within the application’s viewport at which the event occurred (as opposed to the coordinate within the page).

For example, clicking on the left edge of the viewport will always result in a mouse event with a clientX value of 0, regardless of whether the page is scrolled horizontally.

§client_y: i32

The vertical coordinate within the application’s viewport at which the event occurred (as opposed to the coordinate within the page).

For example, clicking on the top edge of the viewport will always result in a mouse event with a clientY value of 0, regardless of whether the page is scrolled vertically.

§ctrl_key: bool

True if the control key was down when the mouse event was fired.

§meta_key: bool

True if the meta key was down when the mouse event was fired.

§offset_x: i32

The offset in the X coordinate of the mouse pointer between that event and the padding edge of the target node.

§offset_y: i32

The offset in the Y coordinate of the mouse pointer between that event and the padding edge of the target node.

§page_x: i32

The X (horizontal) coordinate (in pixels) of the mouse, relative to the left edge of the entire document. This includes any portion of the document not currently visible.

Being based on the edge of the document as it is, this property takes into account any horizontal scrolling of the page. For example, if the page is scrolled such that 200 pixels of the left side of the document are scrolled out of view, and the mouse is clicked 100 pixels inward from the left edge of the view, the value returned by pageX will be 300.

§page_y: i32

The Y (vertical) coordinate in pixels of the event relative to the whole document.

See page_x.

§screen_x: i32

The X coordinate of the mouse pointer in global (screen) coordinates.

§screen_y: i32

The Y coordinate of the mouse pointer in global (screen) coordinates.

§shift_key: bool

True if the shift key was down when the mouse event was fired.

Implementations§

source§

impl SerializedPointInteraction

source

pub fn new( trigger_button: Option<MouseButton>, held_buttons: EnumSet<MouseButton>, coordinates: Coordinates, modifiers: Modifiers ) -> SerializedPointInteraction

Trait Implementations§

source§

impl Clone for SerializedPointInteraction

source§

fn clone(&self) -> SerializedPointInteraction

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SerializedPointInteraction

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Default for SerializedPointInteraction

source§

fn default() -> SerializedPointInteraction

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for SerializedPointInteraction

source§

fn deserialize<__D>( __deserializer: __D ) -> Result<SerializedPointInteraction, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<E> From<&E> for SerializedPointInteraction

source§

fn from(data: &E) -> SerializedPointInteraction

Converts to this type from the input type.
source§

impl InteractionElementOffset for SerializedPointInteraction

source§

fn element_coordinates(&self) -> Point2D<f64, ElementSpace>

Gets the coordinates of the event relative to the target element.
source§

fn coordinates(&self) -> Coordinates

Gets the coordinates of the event.
source§

impl InteractionLocation for SerializedPointInteraction

source§

fn client_coordinates(&self) -> Point2D<f64, ClientSpace>

Gets the coordinates of the event relative to the browser viewport.
source§

fn screen_coordinates(&self) -> Point2D<f64, ScreenSpace>

Gets the coordinates of the event relative to the screen.
source§

fn page_coordinates(&self) -> Point2D<f64, PageSpace>

Gets the coordinates of the event relative to the page.
source§

impl ModifiersInteraction for SerializedPointInteraction

source§

fn modifiers(&self) -> Modifiers

Gets the modifiers of the pointer event.
source§

impl PartialEq for SerializedPointInteraction

source§

fn eq(&self, other: &SerializedPointInteraction) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PointerInteraction for SerializedPointInteraction

source§

fn held_buttons(&self) -> EnumSet<MouseButton>

Gets the buttons that are currently held down.
source§

fn trigger_button(&self) -> Option<MouseButton>

Gets the button that triggered the event.
source§

impl Serialize for SerializedPointInteraction

source§

fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl StructuralPartialEq for SerializedPointInteraction

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, O> SuperFrom<T> for O
where O: From<T>,

source§

fn super_from(input: T) -> O

Convert from a type to another type.
source§

impl<T, O, M> SuperInto<O, M> for T
where O: SuperFrom<T, M>,

source§

fn super_into(self) -> O

Convert from a type to another type.
source§

impl<T> To for T
where T: ?Sized,

source§

fn to<T>(self) -> T
where Self: Into<T>,

Converts to T by calling Into<T>::into.
source§

fn try_to<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Tries to convert to T by calling TryInto<T>::try_into.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<Cfg> TryIntoConfig for Cfg

source§

fn into_config(self) -> Option<Cfg>

Available on crate feature launch only.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DependencyElement for T
where T: 'static + PartialEq + Clone,

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,