pub struct Rect {
pub position: Point,
pub size: Vector,
}Expand description
An axis-aligned rectangle.
Fields§
§position: Point§size: VectorImplementations§
Source§impl Rect
impl Rect
Sourcepub fn new(position: impl Into<Point>, size: impl Into<Vector>) -> Self
pub fn new(position: impl Into<Point>, size: impl Into<Vector>) -> Self
Creates a new rectangle from a position and a size.
Sourcepub fn bottom_left(&self) -> Point
pub fn bottom_left(&self) -> Point
Returns the bottom left corner of the rectangle.
Sourcepub fn bottom_right(&self) -> Point
pub fn bottom_right(&self) -> Point
Returns the bottom right corner of the rectangle.
Trait Implementations§
impl Copy for Rect
impl StructuralPartialEq for Rect
Auto Trait Implementations§
impl Freeze for Rect
impl RefUnwindSafe for Rect
impl Send for Rect
impl Sync for Rect
impl Unpin for Rect
impl UnwindSafe for Rect
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more