Struct mutils::Rect[][src]

pub struct Rect<N: Num = f32>(pub Point<N>, pub Size<N>);

Implementations

impl<N: Num> Rect<N>[src]

pub fn new_from_raw(
    bottom_left_x: N,
    bottom_left_y: N,
    width: N,
    height: N
) -> Self
[src]

pub fn new(bottom_left: Point<N>, size: Size<N>) -> Self[src]

pub fn move_xy(&mut self, xy: Point<N>)[src]

pub fn move_x(&mut self, x: N)[src]

pub fn move_y(&mut self, y: N)[src]

pub fn width(&self) -> N[src]

pub fn height(&self) -> N[src]

pub fn area(&self) -> N[src]

pub fn size(&self) -> Size<N>[src]

pub fn bottom_left(&self) -> Point<N>[src]

pub fn top_y(&self) -> N[src]

pub fn bottom_y(&self) -> N[src]

pub fn left_x(&self) -> N[src]

pub fn right_x(&self) -> N[src]

pub fn top_right(&self) -> Point<N>[src]

pub fn centre(&self) -> Point<N>[src]

pub fn set_bottom_left(&mut self, xy: Point<N>)[src]

pub fn set_centre(&mut self, xy: Point<N>)[src]

pub fn overlaps(&self, other: Self) -> bool[src]

pub fn contains(&self, point: Point<N>) -> bool[src]

pub fn intersect(&self, other: Self) -> Option<Self>[src]

pub fn combine(&self, other: Self) -> Self[src]

pub fn get_scale_diff(&self, other: Self) -> Size<N>[src]

impl<N: Num> Rect<N>[src]

pub fn to_clamped<T: Num + FromClamped<N>>(&self) -> Rect<T>[src]

pub fn to<T: Num + From<N>>(&self) -> Rect<T>[src]

Trait Implementations

impl<N: Num> Add<Point<N>> for Rect<N>[src]

type Output = Self

The resulting type after applying the + operator.

impl<N: Num> Add<Size<N>> for Rect<N>[src]

type Output = Self

The resulting type after applying the + operator.

impl<N: Num> AddAssign<Point<N>> for Rect<N>[src]

impl<N: Num> AddAssign<Size<N>> for Rect<N>[src]

impl<N: Clone + Num> Clone for Rect<N>[src]

impl<N: Copy + Num> Copy for Rect<N>[src]

impl<N: Debug + Num> Debug for Rect<N>[src]

impl<N: Num> IntoIterator for Rect<N>[src]

type Item = Point<N>

The type of the elements being iterated over.

type IntoIter = RectIter<N>

Which kind of iterator are we turning this into?

impl<N: Num> PartialEq<Rect<N>> for Rect<N>[src]

impl<N: Num> Sub<Point<N>> for Rect<N>[src]

type Output = Self

The resulting type after applying the - operator.

impl<N: Num> Sub<Size<N>> for Rect<N>[src]

type Output = Self

The resulting type after applying the - operator.

impl<N: Num> SubAssign<Point<N>> for Rect<N>[src]

impl<N: Num> SubAssign<Size<N>> for Rect<N>[src]

Auto Trait Implementations

impl<N> RefUnwindSafe for Rect<N> where
    N: RefUnwindSafe
[src]

impl<N> Send for Rect<N> where
    N: Send
[src]

impl<N> Sync for Rect<N> where
    N: Sync
[src]

impl<N> Unpin for Rect<N> where
    N: Unpin
[src]

impl<N> UnwindSafe for Rect<N> where
    N: UnwindSafe
[src]

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.