Struct primitives::Rect [−][src]
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>
size: Size<T>
Implementations
Trait Implementations
Auto Trait Implementations
impl<T> RefUnwindSafe for Rect<T> where
T: RefUnwindSafe,
impl<T> UnwindSafe for Rect<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more