Struct evegfx::graphics::Rect [−][src]
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)
wherev
is anything that can convert toVertex2D
.(v1, v2)
where both can convert toVertex2D
, which is the same as callingRect::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]
S::Dim: Clone,
S::Dim: Clone,
S::Dim: Clone,
S::Dim: Clone,
fn clone(&self) -> Rect<S>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<S: Copy + CoordinateSystem> Copy for Rect<S> where
S::Dim: Copy,
S::Dim: Copy,
S::Dim: Copy,
S::Dim: Copy,
[src]
S::Dim: Copy,
S::Dim: Copy,
S::Dim: Copy,
S::Dim: Copy,
impl<S: Debug + CoordinateSystem> Debug for Rect<S> where
S::Dim: Debug,
S::Dim: Debug,
S::Dim: Debug,
S::Dim: Debug,
[src]
S::Dim: Debug,
S::Dim: Debug,
S::Dim: Debug,
S::Dim: Debug,
impl<S: Eq + CoordinateSystem> Eq for Rect<S> where
S::Dim: Eq,
S::Dim: Eq,
S::Dim: Eq,
S::Dim: Eq,
[src]
S::Dim: Eq,
S::Dim: Eq,
S::Dim: Eq,
S::Dim: Eq,
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]
S::Dim: PartialEq,
S::Dim: PartialEq,
S::Dim: PartialEq,
S::Dim: PartialEq,
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]
<S as CoordinateSystem>::Dim: Send,
impl<S> Sync for Rect<S> where
<S as CoordinateSystem>::Dim: Sync,
[src]
<S as CoordinateSystem>::Dim: Sync,
impl<S> Unpin for Rect<S> where
<S as CoordinateSystem>::Dim: Unpin,
[src]
<S as CoordinateSystem>::Dim: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,