#![allow(dead_code)]

pub struct Vector3<T: Copy> {
    v: Box<[T]>
}

impl<T: Copy> Vector3<T> {
    pub fn new(v: Box<[T]>) -> Vector3<T> {
        Vector3 {
            v
        }
    }
    pub fn len(&self) -> usize {
        self.v.len()
    }

    pub fn x(&self) -> T {
        self.v[0]
    }

    pub fn y(&self) -> T {
        self.v[1]
    }

    pub fn z(&self) -> T {
        self.v[2]
    }

    pub fn x_mut(&mut self) -> &mut T {
        &mut self.v[0]
    }

    pub fn y_mut(&mut self) -> &mut T {
        &mut self.v[1]
    }

    pub fn z_mut(&mut self) -> &mut T {
        &mut self.v[2]
    }
}
