Trait rin::math::dimension::Dim[][src]

pub trait Dim: Send + Copy + Sync + PartialEq<Self> + Any + Debug {
    fn try_to_usize() -> Option<usize>;
fn value(&self) -> usize;
fn from_usize(dim: usize) -> Self; fn is<D>() -> bool
    where
        D: Dim
, { ... } }

Trait implemented by any type that can be used as a dimension. This includes type-level integers and Dynamic (for dimensions not known at compile-time).

Required Methods

Gets the compile-time value of Self. Returns None if it is not known, i.e., if Self = Dynamic.

Gets the run-time value of self. For type-level integers, this is the same as Self::try_to_usize().unwrap().

Builds an instance of Self from a run-time value. Panics if Self is a type-level integer and dim != Self::try_to_usize().unwrap().

Provided Methods

Implementations on Foreign Types

impl<U, B> Dim for UInt<U, B> where
    B: Send + Copy + Sync + PartialEq<B> + Any + Debug + Bit,
    U: DimName + Unsigned
[src]

impl<A, B, C, D, E, F, G> Dim for UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, A>, B>, C>, D>, E>, F>, G> where
    A: Send + Copy + Sync + PartialEq<A> + Any + Debug + Bit,
    B: Send + Copy + Sync + PartialEq<B> + Any + Debug + Bit,
    C: Send + Copy + Sync + PartialEq<C> + Any + Debug + Bit,
    D: Send + Copy + Sync + PartialEq<D> + Any + Debug + Bit,
    E: Send + Copy + Sync + PartialEq<E> + Any + Debug + Bit,
    F: Send + Copy + Sync + PartialEq<F> + Any + Debug + Bit,
    G: Send + Copy + Sync + PartialEq<G> + Any + Debug + Bit
[src]

Implementors