Struct euclid::size::Size2D [] [src]

pub struct Size2D<T> {
    pub width: T,
    pub height: T,
}

Fields

width
height

Methods

impl<T: Clone> Size2D<T>

fn new(width: T, height: T) -> Size2D<T>

impl<T: Copy + Clone + Mul<T, Output=U>, U> Size2D<T>

fn area(&self) -> U

impl<T: Zero> Size2D<T>

fn zero() -> Size2D<T>

impl<Unit, T: Clone> Size2D<Length<Unit, T>>

fn typed(width: T, height: T) -> TypedSize2D<Unit, T>

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

Drop the units, preserving only the numeric value.

fn from_untyped(p: &Size2D<T>) -> TypedSize2D<Unit, T>

Tag a unitless value with units.

impl<Unit, T0: NumCast + Clone> Size2D<Length<Unit, T0>>

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

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

impl<Unit, T: NumCast + Clone> Size2D<Length<Unit, T>>

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

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

Trait Implementations

impl<T: Debug> Debug for Size2D<T>

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

impl<T: Display> Display for Size2D<T>

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

impl<T: Zero> Zero for Size2D<T>

fn zero() -> Size2D<T>

impl<Scale: Copy, T0: Mul<Scale, Output=T1>, T1: Clone> Mul<Scale> for Size2D<T0>

type Output = Size2D<T1>

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

impl<Scale: Copy, T0: Div<Scale, Output=T1>, T1: Clone> Div<Scale> for Size2D<T0>

type Output = Size2D<T1>

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

Derived Implementations

impl<T: PartialEq> PartialEq for Size2D<T>

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

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

impl<T: Encodable> Encodable for Size2D<T>

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

impl<T: Decodable> Decodable for Size2D<T>

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

impl<T: Eq> Eq for Size2D<T>

impl<T: Copy> Copy for Size2D<T>

impl<T: Clone> Clone for Size2D<T>

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

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