Struct dimensioned::dimensioned::Dim [] [src]

pub struct Dim<D: Dimension, V>(pub V, pub PhantomData<D>);

Methods

impl<D: Dimension, V> Dim<D, V>

fn new(v: V) -> Dim<D, V>

Trait Implementations

impl<D: Dimension, V> !NotDim for Dim<D, V>

impl<D, A, B> Wrap<B> for Dim<D, A> where D: Dimension

type Output = Dim<D, B>

fn wrap(&self, b: B) -> Dim<D, B>

impl<D, V> Sqrt for Dim<D, V> where D: RootDim<Two>, V: Float, D::Output: Dimension

type Output = Dim<D::Output, V>

fn sqrt(self) -> Self::Output

impl<D, V> Sqr for Dim<D, V> where D: PowerDim<Two>, V: Copy + Mul, D::Output: Dimension

type Output = Dim<D::Output, V::Output>

fn sqr(self) -> Self::Output

impl<D, V> Cube for Dim<D, V> where D: PowerDim<Three>, V: Copy + Mul, D::Output: Dimension, V::Output: Mul<V>

type Output = Dim<D::Output, V::Output::Output>

fn cube(self) -> Self::Output

impl<D, V> Display for Dim<D, V> where D: DimToString, V: Display

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

impl<Dl, Dr, Vl, Vr> Mul<Dim<Dr, Vr>> for Dim<Dl, Vl> where Dl: Dimension + MulDim<Dr>, Dr: Dimension, Vl: Mul<Vr>, Dl::Output: Dimension

Multiplying! Dimensions must be able to add.

type Output = Dim<Dl::Output, Vl::Output>

fn mul(self, rhs: Dim<Dr, Vr>) -> Dim<Dl::Output, Vl::Output>

impl<D, V, RHS> Mul<RHS> for Dim<D, V> where D: Dimension, V: Mul<RHS>, RHS: NotDim

Scalar multiplication (with scalar on RHS)!

type Output = Dim<D, V::Output>

fn mul(self, rhs: RHS) -> Dim<D, V::Output>

impl<Dl, Dr, Vl, Vr> Div<Dim<Dr, Vr>> for Dim<Dl, Vl> where Dl: Dimension + DivDim<Dr>, Dr: Dimension, Vl: Div<Vr>, Dl::Output: Dimension

Dividing! Dimensions must be able to subtract.

type Output = Dim<Dl::Output, Vl::Output>

fn div(self, rhs: Dim<Dr, Vr>) -> Dim<Dl::Output, Vl::Output>

impl<D, V, RHS> Div<RHS> for Dim<D, V> where D: Dimension, V: Div<RHS>, RHS: NotDim

Scalar division (with scalar on RHS)!

type Output = Dim<D, V::Output>

fn div(self, rhs: RHS) -> Dim<D, V::Output>

impl<D, V> Neg for Dim<D, V> where D: KeepDim<D>, V: Neg, D::Output: Dimension

type Output = Dim<D::Output, V::Output>

fn neg(self) -> Dim<D::Output, V::Output>

impl<D, V> Not for Dim<D, V> where D: KeepDim<D>, V: Not, D::Output: Dimension

type Output = Dim<D::Output, V::Output>

fn not(self) -> Dim<D::Output, V::Output>

impl<Dl, Vl, Dr, Vr> Add<Dim<Dr, Vr>> for Dim<Dl, Vl> where Dl: KeepDim<Dr>, Dr: Dimension, Vl: Add<Vr>, Dl::Output: Dimension

type Output = Dim<Dl::Output, Vl::Output>

fn add(self, rhs: Dim<Dr, Vr>) -> Dim<Dl::Output, Vl::Output>

impl<Dl, Vl, Dr, Vr> BitAnd<Dim<Dr, Vr>> for Dim<Dl, Vl> where Dl: KeepDim<Dr>, Dr: Dimension, Vl: BitAnd<Vr>, Dl::Output: Dimension

type Output = Dim<Dl::Output, Vl::Output>

fn bitand(self, rhs: Dim<Dr, Vr>) -> Dim<Dl::Output, Vl::Output>

impl<Dl, Vl, Dr, Vr> BitOr<Dim<Dr, Vr>> for Dim<Dl, Vl> where Dl: KeepDim<Dr>, Dr: Dimension, Vl: BitOr<Vr>, Dl::Output: Dimension

type Output = Dim<Dl::Output, Vl::Output>

fn bitor(self, rhs: Dim<Dr, Vr>) -> Dim<Dl::Output, Vl::Output>

impl<Dl, Vl, Dr, Vr> BitXor<Dim<Dr, Vr>> for Dim<Dl, Vl> where Dl: KeepDim<Dr>, Dr: Dimension, Vl: BitXor<Vr>, Dl::Output: Dimension

type Output = Dim<Dl::Output, Vl::Output>

fn bitxor(self, rhs: Dim<Dr, Vr>) -> Dim<Dl::Output, Vl::Output>

impl<Dl, Vl, Dr, Vr> Rem<Dim<Dr, Vr>> for Dim<Dl, Vl> where Dl: KeepDim<Dr>, Dr: Dimension, Vl: Rem<Vr>, Dl::Output: Dimension

type Output = Dim<Dl::Output, Vl::Output>

fn rem(self, rhs: Dim<Dr, Vr>) -> Dim<Dl::Output, Vl::Output>

impl<Dl, Vl, Dr, Vr> Shl<Dim<Dr, Vr>> for Dim<Dl, Vl> where Dl: KeepDim<Dr>, Dr: Dimension, Vl: Shl<Vr>, Dl::Output: Dimension

type Output = Dim<Dl::Output, Vl::Output>

fn shl(self, rhs: Dim<Dr, Vr>) -> Dim<Dl::Output, Vl::Output>

impl<Dl, Vl, Dr, Vr> Shr<Dim<Dr, Vr>> for Dim<Dl, Vl> where Dl: KeepDim<Dr>, Dr: Dimension, Vl: Shr<Vr>, Dl::Output: Dimension

type Output = Dim<Dl::Output, Vl::Output>

fn shr(self, rhs: Dim<Dr, Vr>) -> Dim<Dl::Output, Vl::Output>

impl<Dl, Vl, Dr, Vr> Sub<Dim<Dr, Vr>> for Dim<Dl, Vl> where Dl: KeepDim<Dr>, Dr: Dimension, Vl: Sub<Vr>, Dl::Output: Dimension

type Output = Dim<Dl::Output, Vl::Output>

fn sub(self, rhs: Dim<Dr, Vr>) -> Dim<Dl::Output, Vl::Output>

impl<D, V> FromPrimitive for Dim<D, V> where D: Dimension, V: FromPrimitive

fn from_i64(n: i64) -> Option<Self>

fn from_u64(n: u64) -> Option<Self>

fn from_isize(n: isize) -> Option<Self>

fn from_i8(n: i8) -> Option<Self>

fn from_i16(n: i16) -> Option<Self>

fn from_i32(n: i32) -> Option<Self>

fn from_usize(n: usize) -> Option<Self>

fn from_u8(n: u8) -> Option<Self>

fn from_u32(n: u32) -> Option<Self>

fn from_f32(n: f32) -> Option<Self>

fn from_f64(n: f64) -> Option<Self>

fn from_u16(n: u16) -> Option<Self>

impl<D, V> ToPrimitive for Dim<D, V> where D: Dimension, V: ToPrimitive

fn to_i64(&self) -> Option<i64>

fn to_u64(&self) -> Option<u64>

fn to_isize(&self) -> Option<isize>

fn to_i8(&self) -> Option<i8>

fn to_i16(&self) -> Option<i16>

fn to_i32(&self) -> Option<i32>

fn to_usize(&self) -> Option<usize>

fn to_u8(&self) -> Option<u8>

fn to_u16(&self) -> Option<u16>

fn to_u32(&self) -> Option<u32>

fn to_f32(&self) -> Option<f32>

fn to_f64(&self) -> Option<f64>

impl<D, V> NumCast for Dim<D, V> where D: Dimension, V: NumCast

fn from<N>(n: N) -> Option<Self> where N: ToPrimitive

Derived Implementations

impl<D: Ord + Dimension, V: Ord> Ord for Dim<D, V> where V: Ord, D: Ord

fn cmp(&self, __arg_0: &Dim<D, V>) -> Ordering

impl<D: PartialOrd + Dimension, V: PartialOrd> PartialOrd for Dim<D, V> where V: PartialOrd, D: PartialOrd

fn partial_cmp(&self, __arg_0: &Dim<D, V>) -> Option<Ordering>

fn lt(&self, __arg_0: &Dim<D, V>) -> bool

fn le(&self, __arg_0: &Dim<D, V>) -> bool

fn gt(&self, __arg_0: &Dim<D, V>) -> bool

fn ge(&self, __arg_0: &Dim<D, V>) -> bool

impl<D: Eq + Dimension, V: Eq> Eq for Dim<D, V> where V: Eq, D: Eq

impl<D: PartialEq + Dimension, V: PartialEq> PartialEq for Dim<D, V> where V: PartialEq, D: PartialEq

fn eq(&self, __arg_0: &Dim<D, V>) -> bool

fn ne(&self, __arg_0: &Dim<D, V>) -> bool

impl<D: Clone + Dimension, V: Clone> Clone for Dim<D, V> where V: Clone, D: Clone

fn clone(&self) -> Dim<D, V>

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

impl<D: Copy + Dimension, V: Copy> Copy for Dim<D, V> where V: Copy, D: Copy