Struct evegfx::graphics::Rect[][src]

pub struct Rect<S: CoordinateSystem> { /* fields omitted */ }

Represents a rectangular region a specific coordinate system, as a top left coordinate vertex, a width, and a height.

Most functions that expect rectangles as arguments are generic over all types that can convert to Rect. That includes the following shorthands based on anonymous tuple types:

  • (x, y, w, h)
  • (v, w, h) where v is anything that can convert to Vertex2D.
  • (v1, v2) where both can convert to Vertex2D, which is the same as calling Rect::with_bounds with those vertices.

Implementations

impl<S: CoordinateSystem> Rect<S>[src]

pub fn new(x: S::Dim, y: S::Dim, w: S::Dim, h: S::Dim) -> Self[src]

pub fn with_bounds(top_left: Vertex2D<S>, bottom_right: Vertex2D<S>) -> Self[src]

pub fn top_left(&self) -> Vertex2D<S>[src]

pub fn bottom_right(&self) -> Vertex2D<S>[src]

pub fn size(&self) -> (S::Dim, S::Dim)[src]

pub fn bounds(&self) -> (Vertex2D<S>, Vertex2D<S>)[src]

Trait Implementations

impl<S: Clone + CoordinateSystem> Clone for Rect<S> where
    S::Dim: Clone,
    S::Dim: Clone,
    S::Dim: Clone,
    S::Dim: Clone
[src]

impl<S: Copy + CoordinateSystem> Copy for Rect<S> where
    S::Dim: Copy,
    S::Dim: Copy,
    S::Dim: Copy,
    S::Dim: Copy
[src]

impl<S: Debug + CoordinateSystem> Debug for Rect<S> where
    S::Dim: Debug,
    S::Dim: Debug,
    S::Dim: Debug,
    S::Dim: Debug
[src]

impl<S: Eq + CoordinateSystem> Eq for Rect<S> where
    S::Dim: Eq,
    S::Dim: Eq,
    S::Dim: Eq,
    S::Dim: Eq
[src]

impl<S: CoordinateSystem> From<(<S as CoordinateSystem>::Dim, <S as CoordinateSystem>::Dim, <S as CoordinateSystem>::Dim, <S as CoordinateSystem>::Dim)> for Rect<S>[src]

impl<S: CoordinateSystem, V: Into<Vertex2D<S>>> From<(V, <S as CoordinateSystem>::Dim, <S as CoordinateSystem>::Dim)> for Rect<S>[src]

impl<S: CoordinateSystem, V1: Into<Vertex2D<S>>, V2: Into<Vertex2D<S>>> From<(V1, V2)> for Rect<S>[src]

impl<S: PartialEq + CoordinateSystem> PartialEq<Rect<S>> for Rect<S> where
    S::Dim: PartialEq,
    S::Dim: PartialEq,
    S::Dim: PartialEq,
    S::Dim: PartialEq
[src]

impl<S: CoordinateSystem> StructuralEq for Rect<S>[src]

impl<S: CoordinateSystem> StructuralPartialEq for Rect<S>[src]

Auto Trait Implementations

impl<S> Send for Rect<S> where
    <S as CoordinateSystem>::Dim: Send
[src]

impl<S> Sync for Rect<S> where
    <S as CoordinateSystem>::Dim: Sync
[src]

impl<S> Unpin for Rect<S> where
    <S as CoordinateSystem>::Dim: Unpin
[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, 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.