Struct euclid::rect::TypedRect
[−]
[src]
pub struct TypedRect<T, U = UnknownUnit> { pub origin: TypedPoint2D<T, U>, pub size: TypedSize2D<T, U>, }
Fields
origin: TypedPoint2D<T, U>
size: TypedSize2D<T, U>
Methods
impl<T, U> TypedRect<T, U>
[src]
fn new(origin: TypedPoint2D<T, U>, size: TypedSize2D<T, U>) -> TypedRect<T, U>
impl<T, U> TypedRect<T, U> where T: Copy + Clone + PartialOrd + Add<T, Output=T> + Sub<T, Output=T>
[src]
fn intersects(&self, other: &TypedRect<T, U>) -> bool
fn max_x(&self) -> T
fn min_x(&self) -> T
fn max_y(&self) -> T
fn min_y(&self) -> T
fn max_x_typed(&self) -> Length<T, U>
fn min_x_typed(&self) -> Length<T, U>
fn max_y_typed(&self) -> Length<T, U>
fn min_y_typed(&self) -> Length<T, U>
fn intersection(&self, other: &TypedRect<T, U>) -> Option<TypedRect<T, U>>
fn translate(&self, other: &TypedPoint2D<T, U>) -> TypedRect<T, U>
fn contains(&self, other: &TypedPoint2D<T, U>) -> bool
fn inflate(&self, width: T, height: T) -> TypedRect<T, U>
fn inflate_typed(&self, width: Length<T, U>, height: Length<T, U>) -> TypedRect<T, U>
fn top_right(&self) -> TypedPoint2D<T, U>
fn bottom_left(&self) -> TypedPoint2D<T, U>
fn bottom_right(&self) -> TypedPoint2D<T, U>
fn translate_by_size(&self, size: &TypedSize2D<T, U>) -> TypedRect<T, U>
impl<T: Copy + Clone + PartialOrd + Add<T, Output=T> + Sub<T, Output=T> + Zero, U> TypedRect<T, U>
[src]
impl<T, U> TypedRect<T, U>
[src]
fn scale<Scale: Copy>(&self, x: Scale, y: Scale) -> TypedRect<T, U> where T: Copy + Clone + Mul<Scale, Output=T>
impl<T: PartialEq + Zero, U> TypedRect<T, U>
[src]
impl<T: Clone, Unit> TypedRect<T, Unit>
[src]
fn to_untyped(&self) -> Rect<T>
Drop the units, preserving only the numeric value.
fn from_untyped(r: &Rect<T>) -> TypedRect<T, Unit>
Tag a unitless value with units.
impl<T0: NumCast + Clone, Unit> TypedRect<T0, Unit>
[src]
fn cast<T1: NumCast + Clone>(&self) -> Option<TypedRect<T1, Unit>>
Cast from one numeric representation to another, preserving the units.
impl<T: NumCast + Clone, Unit> TypedRect<T, Unit>
[src]
Trait Implementations
impl<T: Encodable, U: Encodable> Encodable for TypedRect<T, U>
[src]
impl<T: Decodable, U: Decodable> Decodable for TypedRect<T, U>
[src]
impl<T: HeapSizeOf, U> HeapSizeOf for TypedRect<T, U>
[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::
impl<T: Clone + Deserialize, U> Deserialize for TypedRect<T, U>
[src]
fn deserialize<D>(deserializer: &mut D) -> Result<Self, D::Error> where D: Deserializer
Deserialize this value given this Deserializer
.
impl<T: Serialize, U> Serialize for TypedRect<T, U>
[src]
fn serialize<S>(&self, serializer: &mut S) -> Result<(), S::Error> where S: Serializer
Serializes this value into this serializer.
impl<T: Copy, U> Copy for TypedRect<T, U>
[src]
impl<T: Clone, U> Clone for TypedRect<T, U>
[src]
fn clone(&self) -> TypedRect<T, U>
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: PartialEq, U> PartialEq<TypedRect<T, U>> for TypedRect<T, U>
[src]
fn eq(&self, other: &TypedRect<T, U>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.
impl<T: Eq, U> Eq for TypedRect<T, U>
[src]
impl<T: Debug, U> Debug for TypedRect<T, U>
[src]
impl<T: Display, U> Display for TypedRect<T, U>
[src]
impl<T: Copy + Mul<T, Output=T>, U> Mul<T> for TypedRect<T, U>
[src]
type Output = TypedRect<T, U>
The resulting type after applying the *
operator
fn mul(self, scale: T) -> TypedRect<T, U>
The method for the *
operator
impl<T: Copy + Div<T, Output=T>, U> Div<T> for TypedRect<T, U>
[src]
type Output = TypedRect<T, U>
The resulting type after applying the /
operator
fn div(self, scale: T) -> TypedRect<T, U>
The method for the /
operator
impl<T: Copy + Mul<T, Output=T>, U1, U2> Mul<ScaleFactor<T, U1, U2>> for TypedRect<T, U1>
[src]
type Output = TypedRect<T, U2>
The resulting type after applying the *
operator
fn mul(self, scale: ScaleFactor<T, U1, U2>) -> TypedRect<T, U2>
The method for the *
operator
impl<T: Copy + Div<T, Output=T>, U1, U2> Div<ScaleFactor<T, U1, U2>> for TypedRect<T, U2>
[src]
type Output = TypedRect<T, U1>
The resulting type after applying the /
operator
fn div(self, scale: ScaleFactor<T, U1, U2>) -> TypedRect<T, U1>
The method for the /
operator