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

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

Fields

width: T height: T

Methods

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

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

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

fn area(&self) -> U

impl<T: Zero> Size2D<T>
[src]

fn zero() -> Size2D<T>

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

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>>
[src]

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>>
[src]

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

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

Trait Implementations

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

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

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

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

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

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

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

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

This method tests for !=.

impl<T: Hash> Hash for Size2D<T>
[src]

fn hash<__HT: Hasher>(&self, __arg_0: &mut __HT)

Feeds this value into the state given, updating the hasher as necessary.

fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0

Feeds a slice of this type into the state provided.

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

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

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

fn clone(&self) -> Size2D<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 Size2D<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 Size2D<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 Size2D<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 Size2D<T>
[src]

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

Formats the value using the given formatter.

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

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

Formats the value using the given formatter.

impl<T: Zero> Zero for Size2D<T>
[src]

fn zero() -> Size2D<T>

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

type Output = Size2D<T1>

The resulting type after applying the * operator

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

The method for the * operator

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

type Output = Size2D<T1>

The resulting type after applying the / operator

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

The method for the / operator