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]
impl<T: Copy + Clone + PartialOrd + Add<T, Output=T> + Sub<T, Output=T> + Zero> 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 union(&self, other: &Rect<T>) -> 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> 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]
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]
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]
impl<T: Decodable> Decodable 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: Debug> Debug for Rect<T>
[src]
impl<T: Display> Display for Rect<T>
[src]
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