Struct rin::math::Rect[][src]

pub struct Rect<T = f32> where
    T: BaseNum
{ pub pos: Point<T, U2>, pub width: T, pub height: T, }

Represents a rectangle with operations over it

Fields

pos: Point<T, U2>width: Theight: T

Implementations

impl<T> Rect<T> where
    T: Float + BaseNum
[src]

pub fn aspect_ratio(&self) -> T[src]

pub fn min_x(&self) -> T[src]

pub fn max_x(&self) -> T[src]

pub fn min_y(&self) -> T[src]

pub fn max_y(&self) -> T[src]

pub fn max_pos(&self) -> Point<T, U2>[src]

pub fn min_pos(&self) -> Point<T, U2>[src]

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

pub fn intersection(&self, other: &Rect<T>) -> Rect<T>[src]

impl<T> Rect<T> where
    T: BaseNum + Copy
[src]

pub fn size(
    &self
) -> Matrix<T, U2, U1, <DefaultAllocator as Allocator<T, U2, U1>>::Buffer>
[src]

pub fn position(&self) -> &Point<T, U2>[src]

impl<T> Rect<T> where
    T: BaseNum
[src]

pub fn top_left(&self) -> Point<T, U2>[src]

pub fn top_right(&self) -> Point<T, U2>[src]

pub fn bottom_left(&self) -> Point<T, U2>[src]

pub fn bottom_right(&self) -> Point<T, U2>[src]

pub fn center(&self) -> Point<T, U2> where
    i32: SubsetOf<T>, 
[src]

Trait Implementations

impl<T> AsRef<[T; 4]> for Rect<T> where
    T: BaseNum
[src]

impl<T> Clone for Rect<T> where
    T: Clone + BaseNum
[src]

impl<T> Debug for Rect<T> where
    T: Debug + BaseNum
[src]

impl<'de, T> Deserialize<'de> for Rect<T> where
    T: BaseNum + Deserialize<'de>, 
[src]

impl From<Rect> for Rect<u32>[src]

impl From<Rect> for Rect<i32>[src]

impl From<Viewport> for Rect<i32>[src]

impl<T> Hash for Rect<T> where
    T: Hash + BaseNum
[src]

impl<T> InsideRect<T> for Rect<T> where
    T: Float + BaseNum
[src]

impl Into<Rect> for Rect<i32>[src]

impl Into<Rect> for Rect<u32>[src]

impl<T> PartialEq<Rect<T>> for Rect<T> where
    T: PartialEq<T> + BaseNum
[src]

impl RectToMesh for Rect<f32>[src]

impl<T> Serialize for Rect<T> where
    T: BaseNum + Serialize
[src]

impl<N1, N2> SubsetOf<Rect<N2>> for Rect<N1> where
    N1: BaseNum,
    N2: BaseNum + SupersetOf<N1>,
    Point<N2, U2>: SupersetOf<Point<N1, U2>>, 
[src]

impl<T> Copy for Rect<T> where
    T: Copy + BaseNum
[src]

impl<T> StructuralPartialEq for Rect<T> where
    T: BaseNum
[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Rect<T> where
    T: RefUnwindSafe

impl<T> Send for Rect<T> where
    T: Send

impl<T> Sync for Rect<T> where
    T: Sync

impl<T> Unpin for Rect<T> where
    T: Unpin

impl<T> UnwindSafe for Rect<T> where
    T: UnwindSafe

Blanket Implementations

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

impl<T> Any for T where
    T: Any
[src]

impl<T> AsUniform<dyn AsRef<[[f32; 4]; 4]> + 'static> for T where
    T: AsRef<[[f32; 4]; 4]>, 
[src]

impl<T> AsUniform<dyn AsRef<[f32; 4]> + 'static> for T where
    T: AsRef<[f32; 4]>, 
[src]

impl<T> AsUniform<dyn AsRef<[i32; 4]> + 'static> for T where
    T: AsRef<[i32; 4]>, 
[src]

impl<T> AsUniform<dyn AsRef<[u32; 4]> + 'static> for T where
    T: AsRef<[u32; 4]>, 
[src]

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

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

impl<T> CallHasher for T where
    T: Hash
[src]

impl<T> Color<dyn AsRef<[f32; 4]> + 'static> for T where
    T: AsRef<[f32; 4]> + ?Sized
[src]

impl<T> Downcast for T where
    T: Any
[src]

impl<T> DowncastSync for T where
    T: Any + Send + Sync
[src]

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

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

impl<T> IntoPnt<Point<T, U2>> for T where
    T: Scalar
[src]

impl<T> IntoPnt<Point<T, U3>> for T where
    T: Scalar
[src]

impl<T> IntoPnt<Point<T, U4>> for T where
    T: Scalar
[src]

impl<V> IntoPnt<V> for V[src]

impl<V> IntoVec<V> for V[src]

impl<T> JoinPnt<T, Point<T, U2>> for T where
    T: Scalar
[src]

type Output = Point<T, U3>

impl<T> JoinPnt<T, Point<T, U3>> for T where
    T: Scalar
[src]

type Output = Point<T, U4>

impl<T> JoinPnt<T, T> for T where
    T: Scalar
[src]

type Output = Point<T, U2>

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

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

type Output = T

Should always be Self

impl<T> Scalar for T where
    T: Copy + PartialEq<T> + Debug + Any
[src]

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

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 
[src]

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 
[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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> Slottable for T where
    T: Copy
[src]