Trait rin::math::Dim [−][src]
pub trait Dim: Any + Debug + Copy + PartialEq<Self> + Send + Sync { pub fn try_to_usize() -> Option<usize>; pub fn value(&self) -> usize; pub fn from_usize(dim: usize) -> Self; pub 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
pub fn try_to_usize() -> Option<usize>
[src]
Gets the compile-time value of Self
. Returns None
if it is not known, i.e., if Self = Dynamic
.
pub fn value(&self) -> usize
[src]
Gets the run-time value of self
. For type-level integers, this is the same as
Self::try_to_usize().unwrap()
.
pub fn from_usize(dim: usize) -> Self
[src]
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
Loading content...Implementations on Foreign Types
impl<U, B> Dim for UInt<U, B> where
B: Bit + Any + Debug + Copy + PartialEq<B> + Send + Sync,
U: Unsigned + DimName,
[src]
impl<U, B> Dim for UInt<U, B> where
B: Bit + Any + Debug + Copy + PartialEq<B> + Send + Sync,
U: Unsigned + DimName,
[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
C: Bit + Any + Debug + Copy + PartialEq<C> + Send + Sync,
E: Bit + Any + Debug + Copy + PartialEq<E> + Send + Sync,
B: Bit + Any + Debug + Copy + PartialEq<B> + Send + Sync,
A: Bit + Any + Debug + Copy + PartialEq<A> + Send + Sync,
D: Bit + Any + Debug + Copy + PartialEq<D> + Send + Sync,
F: Bit + Any + Debug + Copy + PartialEq<F> + Send + Sync,
G: Bit + Any + Debug + Copy + PartialEq<G> + Send + Sync,
[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
C: Bit + Any + Debug + Copy + PartialEq<C> + Send + Sync,
E: Bit + Any + Debug + Copy + PartialEq<E> + Send + Sync,
B: Bit + Any + Debug + Copy + PartialEq<B> + Send + Sync,
A: Bit + Any + Debug + Copy + PartialEq<A> + Send + Sync,
D: Bit + Any + Debug + Copy + PartialEq<D> + Send + Sync,
F: Bit + Any + Debug + Copy + PartialEq<F> + Send + Sync,
G: Bit + Any + Debug + Copy + PartialEq<G> + Send + Sync,
[src]Implementors
Loading content...