Enum CoordinateUnit
pub enum CoordinateUnit {
Default,
PhysicalPixels,
// some variants omitted
}
Expand description
Indicates the units used to specify spatial event parameters (unless otherwise noted).
Variants§
Default
The physical display is mapped to a coordinate space spanning [-1000, 1000] on both the x and y axes, where positive x extends rightward and positive y extends downward.
Example: (500, -500) in the default coordinate space maps to the center of the top-right quadrant of the physical display.
PhysicalPixels
The physical display is mapped to a coordinate space spanning (0, 0) - (dispaly width, display height), where positive x extends rightward and positive y extends downward.
Test writers should use fuchsia.ui.display.singleton.Info
to retrieve
the physical dimensions of the display.
Note that this space matches both the size AND orientation of the physical display, so it will NOT mirror any rotations applied to the scene graph.
In general, test writers should NOT assume that a particular view’s logical coordinate space matches the physical coordinate space.
Implementations§
§impl CoordinateUnit
impl CoordinateUnit
pub fn from_primitive(prim: u32) -> Option<CoordinateUnit>
pub fn from_primitive_allow_unknown(prim: u32) -> CoordinateUnit
pub fn unknown() -> CoordinateUnit
pub const fn into_primitive(self) -> u32
pub fn is_unknown(&self) -> bool
Trait Implementations§
§impl Clone for CoordinateUnit
impl Clone for CoordinateUnit
§fn clone(&self) -> CoordinateUnit
fn clone(&self) -> CoordinateUnit
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for CoordinateUnit
impl Debug for CoordinateUnit
§impl<D> Decode<CoordinateUnit, D> for CoordinateUnitwhere
D: ResourceDialect,
impl<D> Decode<CoordinateUnit, D> for CoordinateUnitwhere
D: ResourceDialect,
§fn new_empty() -> CoordinateUnit
fn new_empty() -> CoordinateUnit
Self
. The specific value does not matter,
since it will be overwritten by decode
.§impl<D> Encode<CoordinateUnit, D> for CoordinateUnitwhere
D: ResourceDialect,
impl<D> Encode<CoordinateUnit, D> for CoordinateUnitwhere
D: ResourceDialect,
§impl Hash for CoordinateUnit
impl Hash for CoordinateUnit
§impl Ord for CoordinateUnit
impl Ord for CoordinateUnit
§impl PartialEq for CoordinateUnit
impl PartialEq for CoordinateUnit
§impl PartialOrd for CoordinateUnit
impl PartialOrd for CoordinateUnit
§impl TypeMarker for CoordinateUnit
impl TypeMarker for CoordinateUnit
§type Owned = CoordinateUnit
type Owned = CoordinateUnit
§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 CoordinateUnit
impl ValueTypeMarker for CoordinateUnit
§type Borrowed<'a> = CoordinateUnit
type Borrowed<'a> = CoordinateUnit
Encode<Self>
type cheaply obtainable from &Self::Owned
. There are three cases: Read more§fn borrow(
value: &<CoordinateUnit as TypeMarker>::Owned,
) -> <CoordinateUnit as ValueTypeMarker>::Borrowed<'_>
fn borrow( value: &<CoordinateUnit as TypeMarker>::Owned, ) -> <CoordinateUnit as ValueTypeMarker>::Borrowed<'_>
&Self::Owned
to Self::Borrowed
.