#[repr(C)]pub struct Rect {
pub x: i32,
pub y: i32,
pub width: i32,
pub height: i32,
}
Expand description
An integral, rectangular, axis-aligned region in a 2D cartesian space.
This type does not specify units. Protocols that use this type should specify the characteristics of the vector space, including orientation and units.
Fields§
§x: i32
The location of the origin of the rectangle in the x-axis.
y: i32
The location of the origin of the rectangle in the y-axis.
width: i32
The distance along the x-axis.
If width
is positive, the region includes x values starting at x
and
increasing along the x-axis. If width
is negative, the region includes
x values starting at x
and decreasing along the x-axis.
height: i32
The distance along the y-axis.
If height
is positive, the region includes y values starting at y
and increasing along the y-axis. If height
is negative, the region
includes y values starting at y
and decreasing along the y-axis.
Trait Implementations§
Source§impl<D> Decode<Rect, D> for Rectwhere
D: ResourceDialect,
impl<D> Decode<Rect, D> for Rectwhere
D: ResourceDialect,
Source§impl Ord for Rect
impl Ord for Rect
Source§impl PartialOrd for Rect
impl PartialOrd for Rect
Source§impl TypeMarker for Rect
impl TypeMarker for Rect
Source§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
Source§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align
.Source§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 moreSource§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.Source§impl ValueTypeMarker for Rect
impl ValueTypeMarker for Rect
Source§type Borrowed<'a> = &'a Rect
type Borrowed<'a> = &'a Rect
Encode<Self>
type cheaply obtainable from &Self::Owned
. There are three cases: Read moreSource§fn borrow(
value: &<Rect as TypeMarker>::Owned,
) -> <Rect as ValueTypeMarker>::Borrowed<'_>
fn borrow( value: &<Rect as TypeMarker>::Owned, ) -> <Rect as ValueTypeMarker>::Borrowed<'_>
&Self::Owned
to Self::Borrowed
.