pub struct Rect {
pub position: Point,
pub size: Vector,
}
Expand description
An axis-aligned rectangle.
Creates a new rectangle from a position and a size.
Returns the X coordinate of the rectangle’s position.
Returns the Y coordinate of the rectangle’s position.
Returns the width of the rectangle.
Returns the width of the rectangle.
Returns the left side of the rectangle.
Returns the top side of the rectangle.
Returns the right side of the rectangle.
Returns the bottom side of the rectangle.
Returns the top left corner of the rectangle.
Returns the top right corner of the rectangle.
Returns the bottom left corner of the rectangle.
Returns the bottom right corner of the rectangle.
Returns the center point of the rectangle.
Returns the horizontal (X) center of the rectangle.
Returns the vertical (Y) center of the rectangle.
Returns a sorted rectangle - that is, the same rectangle, but with the width and height
guaranteed to be positive.
Performs copy-assignment from source
. Read more
Formats the value using the given formatter. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
impl<T> Any for T where
T: 'static + ?Sized,
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
impl<T, U> Into<U> for T where
U: From<T>,
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
The type returned in the event of a conversion error.