Struct rusttype::Vector [] [src]

pub struct Vector<N> {
    pub x: N,
    pub y: N,
}

A vector in 2-dimensional space, with each dimension of type N.

Legal operations on vectors are addition and subtraction by vectors, addition by points (to give points), and multiplication and division by scalars.

Fields

Trait Implementations

impl<N: Hash> Hash for Vector<N>
[src]

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

Feeds a slice of this type into the state provided.

impl<N: Eq> Eq for Vector<N>
[src]

impl<N: PartialEq> PartialEq for Vector<N>
[src]

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

This method tests for !=.

impl<N: Ord> Ord for Vector<N>
[src]

This method returns an Ordering between self and other. Read more

impl<N: PartialOrd> PartialOrd for Vector<N>
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<N: Debug> Debug for Vector<N>
[src]

Formats the value using the given formatter.

impl<N: Clone> Clone for Vector<N>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<N: Copy> Copy for Vector<N>
[src]

impl<N: Add<Output=N>> Add for Vector<N>
[src]

The resulting type after applying the + operator

The method for the + operator

impl<N: Sub<Output=N>> Sub for Vector<N>
[src]

The resulting type after applying the - operator

The method for the - operator

impl Mul<f32> for Vector<f32>
[src]

The resulting type after applying the * operator

The method for the * operator

impl Mul<f64> for Vector<f64>
[src]

The resulting type after applying the * operator

The method for the * operator

impl Div<f32> for Vector<f32>
[src]

The resulting type after applying the / operator

The method for the / operator

impl Div<f64> for Vector<f64>
[src]

The resulting type after applying the / operator

The method for the / operator

impl<N: Add<Output=N>> Add<Point<N>> for Vector<N>
[src]

The resulting type after applying the + operator

The method for the + operator