pub struct Rect {
pub x: Length,
pub y: Length,
pub width: Length,
pub height: Length,
}Expand description
A rectangle defined by position and size
Fields§
§x: Length§y: Length§width: Length§height: LengthImplementations§
Source§impl Rect
impl Rect
Sourcepub const fn new(x: Length, y: Length, width: Length, height: Length) -> Rect
pub const fn new(x: Length, y: Length, width: Length, height: Length) -> Rect
Create a new rectangle from position and size
Sourcepub const fn from_point_size(origin: Point, size: Size) -> Rect
pub const fn from_point_size(origin: Point, size: Size) -> Rect
Create a rectangle from a point and size
Sourcepub fn intersects(self, other: Rect) -> bool
pub fn intersects(self, other: Rect) -> bool
Check if this rectangle intersects another
Trait Implementations§
impl Copy for Rect
impl Eq 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 UnsafeUnpin 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