Struct euclid::rect::Rect [] [src]

pub struct Rect<T> {
    pub origin: Point2D<T>,
    pub size: Size2D<T>,
}

Fields

origin: Point2D<T> size: Size2D<T>

Methods

impl<T: Clone> Rect<T>
[src]

fn new(origin: Point2D<T>, size: Size2D<T>) -> Rect<T>

impl<T: Copy + Clone + PartialOrd + Add<T, Output=T> + Sub<T, Output=T>> Rect<T>
[src]

fn intersects(&self, other: &Rect<T>) -> bool

fn max_x(&self) -> T

fn min_x(&self) -> T

fn max_y(&self) -> T

fn min_y(&self) -> T

fn intersection(&self, other: &Rect<T>) -> Option<Rect<T>>

fn translate(&self, other: &Point2D<T>) -> Rect<T>

fn contains(&self, other: &Point2D<T>) -> bool

fn inflate(&self, width: T, height: T) -> Rect<T>

fn top_right(&self) -> Point2D<T>

fn bottom_left(&self) -> Point2D<T>

fn bottom_right(&self) -> Point2D<T>

fn translate_by_size(&self, size: &Size2D<T>) -> Rect<T>

impl<T: Copy + Clone + PartialOrd + Add<T, Output=T> + Sub<T, Output=T> + Zero> Rect<T>
[src]

fn union(&self, other: &Rect<T>) -> Rect<T>

impl<T> Rect<T>
[src]

fn scale<Scale: Copy>(&self, x: Scale, y: Scale) -> Rect<T> where T: Copy + Clone + Mul<Scale, Output=T>

impl<T: PartialEq + Zero> Rect<T>
[src]

fn zero() -> Rect<T>

fn is_empty(&self) -> bool

impl<Unit, T: Clone> Rect<Length<Unit, T>>
[src]

fn to_untyped(&self) -> Rect<T>

Drop the units, preserving only the numeric value.

fn from_untyped(r: &Rect<T>) -> TypedRect<Unit, T>

Tag a unitless value with units.

impl<Unit, T0: NumCast + Clone> Rect<Length<Unit, T0>>
[src]

fn cast<T1: NumCast + Clone>(&self) -> Option<Rect<Length<Unit, T1>>>

Cast from one numeric representation to another, preserving the units.

impl<Unit, T: NumCast + Clone> Rect<Length<Unit, T>>
[src]

fn as_f32(&self) -> Rect<Length<Unit, f32>>

fn as_uint(&self) -> Rect<Length<Unit, usize>>

Trait Implementations

impl<T: PartialEq> PartialEq for Rect<T>
[src]

fn eq(&self, __arg_0: &Rect<T>) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, __arg_0: &Rect<T>) -> bool

This method tests for !=.

impl<T: Encodable> Encodable for Rect<T>
[src]

fn encode<__ST: Encoder>(&self, __arg_0: &mut __ST) -> Result<(), __ST::Error>

impl<T: Decodable> Decodable for Rect<T>
[src]

fn decode<__DT: Decoder>(__arg_0: &mut __DT) -> Result<Rect<T>, __DT::Error>

impl<T: Eq> Eq for Rect<T>
[src]

impl<T: Copy> Copy for Rect<T>
[src]

impl<T: Clone> Clone for Rect<T>
[src]

fn clone(&self) -> Rect<T>

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl<T: HeapSizeOf> HeapSizeOf for Rect<T>
[src]

fn heap_size_of_children(&self) -> usize

Measure the size of any heap-allocated structures that hang off this value, but not the space taken up by the value itself (i.e. what size_of:: measures, more or less); that space is handled by the implementation of HeapSizeOf for Box below. Read more

impl<T: Deserialize> Deserialize for Rect<T>
[src]

fn deserialize<D>(deserializer: &mut D) -> Result<Self, D::Error> where D: Deserializer

Deserialize this value given this Deserializer.

impl<T: Serialize> Serialize for Rect<T>
[src]

fn serialize<S>(&self, serializer: &mut S) -> Result<(), S::Error> where S: Serializer

Serializes this value into this serializer.

impl<T: Debug> Debug for Rect<T>
[src]

fn fmt(&self, f: &mut Formatter) -> Result

Formats the value using the given formatter.

impl<T: Display> Display for Rect<T>
[src]

fn fmt(&self, formatter: &mut Formatter) -> Result

Formats the value using the given formatter.

impl<Scale: Copy, T0: Mul<Scale, Output=T1>, T1: Clone> Mul<Scale> for Rect<T0>
[src]

type Output = Rect<T1>

The resulting type after applying the * operator

fn mul(self, scale: Scale) -> Rect<T1>

The method for the * operator

impl<Scale: Copy, T0: Div<Scale, Output=T1>, T1: Clone> Div<Scale> for Rect<T0>
[src]

type Output = Rect<T1>

The resulting type after applying the / operator

fn div(self, scale: Scale) -> Rect<T1>

The method for the / operator