[−][src]Struct quadtree_rs::area::Area
A rectangular region in 2d space.
Lightweight, should be passed by value. Defined by its top-left anchor, width, and height.
NB:
- The top-left anchor can be any valid
(U, U)
coordinate, positive or negative, in any quadrant. - The width and height must both be positive and nonzero.
Methods
impl<U> Area<U> where
U: PrimInt + Default,
[src]
U: PrimInt + Default,
pub fn anchor(&self) -> Point<U>
[src]
The top-left coordinate (anchor) of the region.
pub fn width(&self) -> U
[src]
The width of the region.
pub fn height(&self) -> U
[src]
The height of the region.
pub fn top_edge(&self) -> U
[src]
The coordinate of the top edge of the region.
pub fn bottom_edge(&self) -> U
[src]
The coordinate of the bottom edge of the region.
pub fn left_edge(&self) -> U
[src]
The coordinate of the left edge of the region.
pub fn right_edge(&self) -> U
[src]
The coordinate of the right edge of the region.
pub fn intersects(self, other: Self) -> bool
[src]
Whether or not an area intersects another area.
pub fn contains(self, other: Self) -> bool
[src]
Whether or not an area wholly contains another area.
pub fn contains_pt(self, pt: Point<U>) -> bool
[src]
Whether or not an area contains a point.
Trait Implementations
impl<U: Copy> Copy for Area<U> where
U: PrimInt + Default + PartialOrd,
[src]
U: PrimInt + Default + PartialOrd,
impl<U: PartialEq> PartialEq<Area<U>> for Area<U> where
U: PrimInt + Default + PartialOrd,
[src]
U: PrimInt + Default + PartialOrd,
impl<U: Eq> Eq for Area<U> where
U: PrimInt + Default + PartialOrd,
[src]
U: PrimInt + Default + PartialOrd,
impl<U: Clone> Clone for Area<U> where
U: PrimInt + Default + PartialOrd,
[src]
U: PrimInt + Default + PartialOrd,
fn clone(&self) -> Area<U>
[src]
default fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<U> Into<((U, U), (U, U))> for Area<U> where
U: PrimInt + Default,
[src]
U: PrimInt + Default,
impl<U: Hash> Hash for Area<U> where
U: PrimInt + Default + PartialOrd,
[src]
U: PrimInt + Default + PartialOrd,
fn hash<__HU: Hasher>(&self, state: &mut __HU)
[src]
default fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<U> Debug for Area<U> where
U: PrimInt + Default + Debug,
[src]
U: PrimInt + Default + Debug,
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,