pub struct Rectangle {
pub min_bounds: Vec<f64>,
pub max_bounds: Vec<f64>,
}Expand description
Rectangle/Bounding box for spatial queries
Fields§
§min_bounds: Vec<f64>§max_bounds: Vec<f64>Implementations§
Source§impl Rectangle
impl Rectangle
pub fn new(min_bounds: Vec<f64>, max_bounds: Vec<f64>) -> Self
pub fn dimension(&self) -> usize
pub fn contains(&self, point: &Point) -> bool
pub fn intersects(&self, other: &Rectangle) -> bool
pub fn area(&self) -> f64
pub fn expand_to_include(&mut self, point: &Point)
pub fn union(&self, other: &Rectangle) -> Rectangle
Trait Implementations§
impl StructuralPartialEq for Rectangle
Auto Trait Implementations§
impl Freeze for Rectangle
impl RefUnwindSafe for Rectangle
impl Send for Rectangle
impl Sync for Rectangle
impl Unpin for Rectangle
impl UnwindSafe for Rectangle
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more