Struct axgeom::Rect

source ·
#[repr(transparent)]
pub struct Rect<T: Copy>(pub [Range<T>; 2]);
Expand description

An axis aligned rectangle. Stored as two Ranges. It is a fully closed rectangle. Points exactly along the border of the rectangle are considered inside the rectangle.

Tuple Fields§

§0: [Range<T>; 2]

Implementations§

(a,b) is the x component range. (c,d) is the y component range.

(a,b) is the x component range. (c,d) is the y component range.

Subdivides the rectangle. No floating point calculations are done (so no precision loss/rounding issues).

Returns true if the specified rect is inside of this rect.

Grow the rectangle to fit the specified rectangle by replacing values with the specified rectangle. No floating point computations.

Get an intersecting rectangle. No floating point calculations as the new rectangle is made up of values from this rectangle and the specified rectangle.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.