Struct euclid::point::TypedPoint2D [] [src]

pub struct TypedPoint2D<T, U> {
    pub x: T,
    pub y: T,
    // some fields omitted
}

Fields

x: T y: T

Methods

impl<T: Zero, U> TypedPoint2D<T, U>
[src]

fn zero() -> TypedPoint2D<T, U>

impl<T, U> TypedPoint2D<T, U>
[src]

fn new(x: T, y: T) -> TypedPoint2D<T, U>

impl<T: Clone, U> TypedPoint2D<T, U>
[src]

fn from_lengths(x: Length<T, U>, y: Length<T, U>) -> TypedPoint2D<T, U>

impl<T: Clone, U> TypedPoint2D<T, U>
[src]

fn x_typed(&self) -> Length<T, U>

fn y_typed(&self) -> Length<T, U>

impl<T, U> TypedPoint2D<T, U> where T: Copy + Mul<T, Output=T> + Add<T, Output=T> + Sub<T, Output=T>
[src]

fn dot(self, other: TypedPoint2D<T, U>) -> T

fn cross(self, other: TypedPoint2D<T, U>) -> T

impl<T: Copy + Add<T, Output=T>, U> TypedPoint2D<T, U>
[src]

fn add_size(&self, other: &TypedSize2D<T, U>) -> TypedPoint2D<T, U>

impl<T: Float, U> TypedPoint2D<T, U>
[src]

fn min(self, other: TypedPoint2D<T, U>) -> TypedPoint2D<T, U>

fn max(self, other: TypedPoint2D<T, U>) -> TypedPoint2D<T, U>

impl<T: Clone, U> TypedPoint2D<T, U>
[src]

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

Drop the units, preserving only the numeric value.

fn from_untyped(p: &Point2D<T>) -> TypedPoint2D<T, U>

Tag a unitless value with units.

impl<T0: NumCast + Clone, U> TypedPoint2D<T0, U>
[src]

fn cast<T1: NumCast + Clone>(&self) -> Option<TypedPoint2D<T1, U>>

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

impl<T: NumCast + Clone, U> TypedPoint2D<T, U>
[src]

fn as_f32(&self) -> TypedPoint2D<f32, U>

fn as_uint(&self) -> TypedPoint2D<usize, U>

Trait Implementations

impl<T: Encodable, U: Encodable> Encodable for TypedPoint2D<T, U>
[src]

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

impl<T: Decodable, U: Decodable> Decodable for TypedPoint2D<T, U>
[src]

fn decode<__DTU: Decoder>(__arg_0: &mut __DTU) -> Result<TypedPoint2D<T, U>, __DTU::Error>

impl<T: HeapSizeOf, U> HeapSizeOf for TypedPoint2D<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:: measures, more or less); that space is handled by the implementation of HeapSizeOf for Box below. Read more

impl<T: Clone + Deserialize, U> Deserialize for TypedPoint2D<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 TypedPoint2D<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 TypedPoint2D<T, U>
[src]

impl<T: Clone, U> Clone for TypedPoint2D<T, U>
[src]

fn clone(&self) -> TypedPoint2D<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<TypedPoint2D<T, U>> for TypedPoint2D<T, U>
[src]

fn eq(&self, other: &TypedPoint2D<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 TypedPoint2D<T, U>
[src]

impl<T: Hash, U> Hash for TypedPoint2D<T, U>
[src]

fn hash<H: Hasher>(&self, h: &mut H)

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: Debug, U> Debug for TypedPoint2D<T, U>
[src]

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

Formats the value using the given formatter.

impl<T: Display, U> Display for TypedPoint2D<T, U>
[src]

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

Formats the value using the given formatter.

impl<T: Clone + Add<T, Output=T>, U> Add for TypedPoint2D<T, U>
[src]

type Output = TypedPoint2D<T, U>

The resulting type after applying the + operator

fn add(self, other: TypedPoint2D<T, U>) -> TypedPoint2D<T, U>

The method for the + operator

impl<T: Clone + Add<T, Output=T>, U> Add<TypedSize2D<T, U>> for TypedPoint2D<T, U>
[src]

type Output = TypedPoint2D<T, U>

The resulting type after applying the + operator

fn add(self, other: TypedSize2D<T, U>) -> TypedPoint2D<T, U>

The method for the + operator

impl<T: Clone + Sub<T, Output=T>, U> Sub for TypedPoint2D<T, U>
[src]

type Output = TypedPoint2D<T, U>

The resulting type after applying the - operator

fn sub(self, other: TypedPoint2D<T, U>) -> TypedPoint2D<T, U>

The method for the - operator

impl<T: Clone + Neg<Output=T>, U> Neg for TypedPoint2D<T, U>
[src]

type Output = TypedPoint2D<T, U>

The resulting type after applying the - operator

fn neg(self) -> TypedPoint2D<T, U>

The method for the unary - operator

impl<T: Copy + Mul<T, Output=T>, U> Mul<T> for TypedPoint2D<T, U>
[src]

type Output = TypedPoint2D<T, U>

The resulting type after applying the * operator

fn mul(self, scale: T) -> TypedPoint2D<T, U>

The method for the * operator

impl<T: Copy + Div<T, Output=T>, U> Div<T> for TypedPoint2D<T, U>
[src]

type Output = TypedPoint2D<T, U>

The resulting type after applying the / operator

fn div(self, scale: T) -> TypedPoint2D<T, U>

The method for the / operator

impl<T: Copy + Mul<T, Output=T>, U1, U2> Mul<ScaleFactor<T, U1, U2>> for TypedPoint2D<T, U1>
[src]

type Output = TypedPoint2D<T, U2>

The resulting type after applying the * operator

fn mul(self, scale: ScaleFactor<T, U1, U2>) -> TypedPoint2D<T, U2>

The method for the * operator

impl<T: Copy + Div<T, Output=T>, U1, U2> Div<ScaleFactor<T, U1, U2>> for TypedPoint2D<T, U2>
[src]

type Output = TypedPoint2D<T, U1>

The resulting type after applying the / operator

fn div(self, scale: ScaleFactor<T, U1, U2>) -> TypedPoint2D<T, U1>

The method for the / operator