pub struct Rectangle<T> {
pub x_min: T,
pub x_max: T,
pub y_min: T,
pub y_max: T,
}Expand description
A rectangular region defined by minimum and maximum x- and y-coordinate positions.
Fields§
§x_min: TThe minimum x-position of the rectangle.
x_max: TThe maximum x-position of the rectangle.
y_min: TThe minimum y-position of the rectangle.
y_max: TThe maximum y-position of the rectangle.
Implementations§
Source§impl<T: Coordinate> Rectangle<T>
impl<T: Coordinate> Rectangle<T>
pub const INVALID: Self
pub const ZERO: Self
pub fn is_valid(&self) -> bool
pub fn encompass(self, point: Point<T>) -> Self
pub fn union(self, other: &Self) -> Self
pub fn intersects(&self, other: &Self) -> bool
pub fn grow(self, amount: T) -> Self
pub fn is_point(&self) -> bool
Trait Implementations§
impl<T: Eq> Eq for Rectangle<T>
impl<T> StructuralPartialEq for Rectangle<T>
Auto Trait Implementations§
impl<T> Freeze for Rectangle<T>where
T: Freeze,
impl<T> RefUnwindSafe for Rectangle<T>where
T: RefUnwindSafe,
impl<T> Send for Rectangle<T>where
T: Send,
impl<T> Sync for Rectangle<T>where
T: Sync,
impl<T> Unpin for Rectangle<T>where
T: Unpin,
impl<T> UnwindSafe for Rectangle<T>where
T: UnwindSafe,
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