Struct PointerSample
pub struct PointerSample {
pub pointer_id: Option<u32>,
pub phase: Option<EventPhase>,
pub position_in_viewport: Option<[f32; 2]>,
pub scroll_v: Option<i64>,
pub scroll_h: Option<i64>,
pub pressed_buttons: Option<Vec<u8>>,
pub relative_motion: Option<[f32; 2]>,
pub scroll_v_physical_pixel: Option<f64>,
pub scroll_h_physical_pixel: Option<f64>,
pub is_precision_scroll: Option<bool>,
/* private fields */
}
Expand description
A description of each sampled data point for a pointer device.
Fields§
§pointer_id: Option<u32>
An identifier of the pointer that issued this event. It is unique only to a specific pointer device.
phase: Option<EventPhase>
The state of this event in the pointer event stream’s state machine.
position_in_viewport: Option<[f32; 2]>
The position of this event, in the viewport’s coordinate system.
scroll_v: Option<i64>
Relative vertical scrolling displacement by detent.
scroll_h: Option<i64>
Relative horizontal scrolling displacement by detent.
Identifiers of currently pressed buttons.
relative_motion: Option<[f32; 2]>
The movement of a mouse, independent of the viewport’s coordinate system.
scroll_v_physical_pixel: Option<f64>
Recommended vertical scrolling displacement by physical pixel, it is computed with accelerator, detent / mm to pixel ratio, etc.
scroll_h_physical_pixel: Option<f64>
Recommended horizontal scrolling displacement by physical pixel, it is computed with accelerator, detent / mm to pixel ratio, etc.
is_precision_scroll: Option<bool>
Indicated if the scroll event is from a precision scroll device (HI_RES mouse or touchpad). Clients may want to play interpolation animations on non precision scroll device for smooth scrolling.
Trait Implementations§
§impl Clone for PointerSample
impl Clone for PointerSample
§fn clone(&self) -> PointerSample
fn clone(&self) -> PointerSample
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for PointerSample
impl Debug for PointerSample
§impl<D> Decode<PointerSample, D> for PointerSamplewhere
D: ResourceDialect,
impl<D> Decode<PointerSample, D> for PointerSamplewhere
D: ResourceDialect,
§fn new_empty() -> PointerSample
fn new_empty() -> PointerSample
Self
. The specific value does not matter,
since it will be overwritten by decode
.§impl Default for PointerSample
impl Default for PointerSample
§fn default() -> PointerSample
fn default() -> PointerSample
§impl<D> Encode<PointerSample, D> for &PointerSamplewhere
D: ResourceDialect,
impl<D> Encode<PointerSample, D> for &PointerSamplewhere
D: ResourceDialect,
§impl PartialEq for PointerSample
impl PartialEq for PointerSample
§impl TypeMarker for PointerSample
impl TypeMarker for PointerSample
§type Owned = PointerSample
type Owned = PointerSample
§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align
.§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned
to a single memcpy. Read more§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned
to a single memcpy.§impl ValueTypeMarker for PointerSample
impl ValueTypeMarker for PointerSample
§type Borrowed<'a> = &'a PointerSample
type Borrowed<'a> = &'a PointerSample
Encode<Self>
type cheaply obtainable from &Self::Owned
. There are three cases: Read more§fn borrow(
value: &<PointerSample as TypeMarker>::Owned,
) -> <PointerSample as ValueTypeMarker>::Borrowed<'_>
fn borrow( value: &<PointerSample as TypeMarker>::Owned, ) -> <PointerSample as ValueTypeMarker>::Borrowed<'_>
&Self::Owned
to Self::Borrowed
.