Struct primitives::foundation::Rect
source · [−]Expand description
A 2d Rectangle optionally tagged with a unit.
Representation
Rect
is represented by an origin point and a size.
See Box2D
for a rectangle represented by two endpoints.
Empty rectangle
A rectangle is considered empty (see is_empty
) if any of the following is true:
- it’s area is empty,
- it’s area is negative (
size.x < 0
orsize.y < 0
), - it contains NaNs.
Fields
origin: Point<T>
Origin of rectangle
size: Size<T>
Size of rectangle
Implementations
Trait Implementations
impl<T: Copy> Copy for Rect<T>
impl<T: Eq> Eq for Rect<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for Rect<T> where
T: RefUnwindSafe,
impl<T> Send for Rect<T> where
T: Send,
impl<T> Sync for Rect<T> where
T: Sync,
impl<T> Unpin for Rect<T> where
T: Unpin,
impl<T> UnwindSafe for Rect<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more