Struct rstar::primitives::Rectangle
source · pub struct Rectangle<P>where
P: Point,{ /* private fields */ }
Expand description
An n-dimensional rectangle defined by its two corners.
This rectangle can be directly inserted into an r-tree.
Note: Despite being called rectangle, this struct can be used with more than two dimensions by using an appropriate point type.
Type parameters
P
: The rectangle’s point type.
Implementations
sourceimpl<P> Rectangle<P>where
P: Point,
impl<P> Rectangle<P>where
P: Point,
sourcepub fn from_corners(corner_1: P, corner_2: P) -> Self
pub fn from_corners(corner_1: P, corner_2: P) -> Self
Creates a new rectangle defined by two corners.
sourcepub fn from_aabb(aabb: AABB<P>) -> Self
pub fn from_aabb(aabb: AABB<P>) -> Self
Creates a new rectangle defined by it’s axis aligned bounding box.
Trait Implementations
sourceimpl<P: Ord> Ord for Rectangle<P>where
P: Point,
impl<P: Ord> Ord for Rectangle<P>where
P: Point,
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<P: PartialEq> PartialEq<Rectangle<P>> for Rectangle<P>where
P: Point,
impl<P: PartialEq> PartialEq<Rectangle<P>> for Rectangle<P>where
P: Point,
sourceimpl<P: PartialOrd> PartialOrd<Rectangle<P>> for Rectangle<P>where
P: Point,
impl<P: PartialOrd> PartialOrd<Rectangle<P>> for Rectangle<P>where
P: Point,
sourcefn partial_cmp(&self, other: &Rectangle<P>) -> Option<Ordering>
fn partial_cmp(&self, other: &Rectangle<P>) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresourceimpl<P> PointDistance for Rectangle<P>where
P: Point,
impl<P> PointDistance for Rectangle<P>where
P: Point,
sourceimpl<P> RTreeObject for Rectangle<P>where
P: Point,
impl<P> RTreeObject for Rectangle<P>where
P: Point,
impl<P: Copy> Copy for Rectangle<P>where
P: Point,
impl<P: Eq> Eq for Rectangle<P>where
P: Point,
impl<P> StructuralEq for Rectangle<P>where
P: Point,
impl<P> StructuralPartialEq for Rectangle<P>where
P: Point,
Auto Trait Implementations
impl<P> RefUnwindSafe for Rectangle<P>where
P: RefUnwindSafe,
impl<P> Send for Rectangle<P>where
P: Send,
impl<P> Sync for Rectangle<P>where
P: Sync,
impl<P> Unpin for Rectangle<P>where
P: Unpin,
impl<P> UnwindSafe for Rectangle<P>where
P: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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