Trait ConstIndex

Source
pub unsafe trait ConstIndex<T, const N: usize> {
    // Required method
    fn i(self, index: usize) -> T;
}
Expand description

implement this on types that can be indexed into that have a size known at compile time

mutability: just implement this twice, with &E &mut E as T

unsafety: calling .i(x) with x < N must successfully return T

unsafety: .i(x) and .i(y) return different objects when x != y. i.e. they do not alias.

Required Methods§

Source

fn i(self, index: usize) -> T

Implementors§

Source§

impl<'a, T, const M: usize, const N: usize> ConstIndex<&'a T, M> for VectorView<'a, T, M, N>

Source§

impl<'a, T, const M: usize, const N: usize> ConstIndex<VectorView<'a, T, M, N>, N> for TransposedMatrixView<'a, T, M, N>

Source§

impl<'a, T, const N: usize> ConstIndex<&'a T, N> for &'a Vector<T, N>

Source§

impl<'a, T, const N: usize> ConstIndex<&'a mut T, N> for &'a mut Vector<T, N>

Source§

impl<'a, T, const N: usize> ConstIndex<T, N> for Vector<T, N>
where T: Copy,

Source§

impl<T, L, R, LT, RT, const N: usize> ConstIndex<T, N> for VAdd<T, L, R, LT, RT, N>
where L: ConstIndex<LT, N> + Copy + Clone, R: ConstIndex<RT, N> + Copy + Clone, LT: Add<RT, Output = T>,