[][src]Struct thyme::Rect

pub struct Rect {
    pub pos: Point,
    pub size: Point,
}

A rectangular area, represented by a position and a size

Fields

pos: Point

The position of the rectangle

size: Point

The size of the rectangle

Implementations

impl Rect[src]

pub fn new(pos: Point, size: Point) -> Rect[src]

Construct a new Rect with the specified position and size.

pub fn left(&self) -> f32[src]

Returns the left edge of this Rect.

pub fn right(&self) -> f32[src]

Returns the right edge of this Rect.

pub fn top(&self) -> f32[src]

Returns the top edge of this Rect.

pub fn bot(&self) -> f32[src]

Returns the bottom edge of this Rect.

pub fn is_inside(&self, pos: Point) -> bool[src]

Returns true if the specified point is inside (or on the edge of) this rectangle; false otherwise

pub fn min(self, other: Rect) -> Rect[src]

Returns a new Rect this is the minimum extent on a component-by-component basis between this and other. The returned Rect will barely fit inside both this and other (if possible - if not it will have size 0)

pub fn max(self, other: Rect) -> Rect[src]

Returns a new Rect that is the maximum extent on a component-by-component basis between this and other. The returned Rect will barely contain both this and other.

Trait Implementations

impl Clone for Rect[src]

impl Copy for Rect[src]

impl Debug for Rect[src]

impl Default for Rect[src]

impl<'de> Deserialize<'de> for Rect[src]

impl Mul<Rect> for f32[src]

type Output = Rect

The resulting type after applying the * operator.

impl Mul<f32> for Rect[src]

type Output = Rect

The resulting type after applying the * operator.

impl PartialEq<Rect> for Rect[src]

impl Serialize for Rect[src]

impl StructuralPartialEq for Rect[src]

Auto Trait Implementations

impl RefUnwindSafe for Rect

impl Send for Rect

impl Sync for Rect

impl Unpin for Rect

impl UnwindSafe for Rect

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> Content for T where
    T: Copy

type Owned = T

A type that holds a sized version of the content.

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

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

impl<T> Instrument for T[src]

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

impl<T> Serialize for T where
    T: Serialize + ?Sized
[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.