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

x
y

Trait Implementations

impl<N: Add<Output=N>> Add for Vector<N>

type Output = Vector<N>

fn add(self, rhs: Vector<N>) -> Vector<N>

impl<N: Sub<Output=N>> Sub for Vector<N>

type Output = Vector<N>

fn sub(self, rhs: Vector<N>) -> Vector<N>

impl Mul<f32> for Vector<f32>

type Output = Vector<f32>

fn mul(self, rhs: f32) -> Vector<f32>

impl Mul<f64> for Vector<f64>

type Output = Vector<f64>

fn mul(self, rhs: f64) -> Vector<f64>

impl Div<f32> for Vector<f32>

type Output = Vector<f32>

fn div(self, rhs: f32) -> Vector<f32>

impl Div<f64> for Vector<f64>

type Output = Vector<f64>

fn div(self, rhs: f64) -> Vector<f64>

impl<N: Add<Output=N>> Add<Point<N>> for Vector<N>

type Output = Point<N>

fn add(self, rhs: Point<N>) -> Point<N>

Derived Implementations

impl<N: Hash> Hash for Vector<N>

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

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

impl<N: Eq> Eq for Vector<N>

impl<N: PartialEq> PartialEq for Vector<N>

fn eq(&self, __arg_0: &Vector<N>) -> bool

fn ne(&self, __arg_0: &Vector<N>) -> bool

impl<N: Ord> Ord for Vector<N>

fn cmp(&self, __arg_0: &Vector<N>) -> Ordering

impl<N: PartialOrd> PartialOrd for Vector<N>

fn partial_cmp(&self, __arg_0: &Vector<N>) -> Option<Ordering>

fn lt(&self, __arg_0: &Vector<N>) -> bool

fn le(&self, __arg_0: &Vector<N>) -> bool

fn gt(&self, __arg_0: &Vector<N>) -> bool

fn ge(&self, __arg_0: &Vector<N>) -> bool

impl<N: Debug> Debug for Vector<N>

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

impl<N: Clone> Clone for Vector<N>

fn clone(&self) -> Vector<N>

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

impl<N: Copy> Copy for Vector<N>