[][src]Struct quadtree_rs::area::Area

pub struct Area<U> where
    U: PrimInt + Default + PartialOrd
{ /* fields omitted */ }

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]

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]

impl<U: PartialEq> PartialEq<Area<U>> for Area<U> where
    U: PrimInt + Default + PartialOrd
[src]

impl<U: Eq> Eq for Area<U> where
    U: PrimInt + Default + PartialOrd
[src]

impl<U: Clone> Clone for Area<U> where
    U: PrimInt + Default + PartialOrd
[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]

impl<U: Hash> Hash for Area<U> where
    U: PrimInt + Default + PartialOrd
[src]

default fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl<U> Debug for Area<U> where
    U: PrimInt + Default + Debug
[src]

Auto Trait Implementations

impl<U> Send for Area<U> where
    U: Send

impl<U> Sync for Area<U> where
    U: Sync

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.