Type Definition slas::StaticVecRef
source · [−]pub type StaticVecRef<'a, T, const LEN: usize> = &'a StaticVecUnion<'a, T, LEN>;
Expand description
StaticVectorUnion is always owned when it is not found in a StaticCowVec, therefore we have this type alias to make it less confisung when dealing with references to owned vectors.
Trait Implementations
sourceimpl<'a, T: Copy, const LEN: usize> StaticVec<T, LEN> for StaticVecRef<'a, T, LEN>
impl<'a, T: Copy, const LEN: usize> StaticVec<T, LEN> for StaticVecRef<'a, T, LEN>
sourceunsafe fn as_mut_ptr(&mut self) -> *mut T
unsafe fn as_mut_ptr(&mut self) -> *mut T
Return mutable pointer to first element. Read more
sourcefn moo_ref<'a>(&'a self) -> StaticVecRef<'a, T, LEN> where
T: Copy,
fn moo_ref<'a>(&'a self) -> StaticVecRef<'a, T, LEN> where
T: Copy,
Return a reference to self with the type of StaticVecUnion
sourcefn mut_moo_ref<'a>(&'a mut self) -> MutStaticVecRef<'a, T, LEN> where
T: Copy,
fn mut_moo_ref<'a>(&'a mut self) -> MutStaticVecRef<'a, T, LEN> where
T: Copy,
Return a mutable reference to self with the type of StaticVecUnion
.
If you want to write to a StaticVec, this is the method that should be used.
This method is re-implemented for StaticCowVecs,
so it perserves cow behavior even when cows are borrowed as StaticVec’s. Read more
sourcefn moo<'a>(&'a self) -> StaticCowVec<'a, T, LEN> where
T: Copy,
fn moo<'a>(&'a self) -> StaticCowVec<'a, T, LEN> where
T: Copy,
Return a cow vector containing a reference to self.
sourceunsafe fn get_unchecked<'a>(&'a self, i: usize) -> &'a T
unsafe fn get_unchecked<'a>(&'a self, i: usize) -> &'a T
Indexing without bounds checking. Read more
sourceunsafe fn get_unchecked_mut<'a>(&'a mut self, i: usize) -> &'a mut T where
T: Copy,
unsafe fn get_unchecked_mut<'a>(&'a mut self, i: usize) -> &'a mut T where
T: Copy,
Same as Self::get_unchecked
but mutable. Read more
sourceunsafe fn static_slice_unchecked<'a, const SLEN: usize>(
&'a self,
i: usize
) -> &'a [T; SLEN]
unsafe fn static_slice_unchecked<'a, const SLEN: usize>(
&'a self,
i: usize
) -> &'a [T; SLEN]
Returns a static slice spanning from index i to i+SLEN. Read more
sourceunsafe fn mut_static_slice_unchecked<'a, const SLEN: usize>(
&'a mut self,
i: usize
) -> &'a mut [T; SLEN]
unsafe fn mut_static_slice_unchecked<'a, const SLEN: usize>(
&'a mut self,
i: usize
) -> &'a mut [T; SLEN]
Returns a mutable static slice spanning from index i to i+SLEN. Read more
sourcefn moo_owned(&self) -> StaticVecUnion<'static, T, LEN> where
T: Copy,
Self: Sized,
fn moo_owned(&self) -> StaticVecUnion<'static, T, LEN> where
T: Copy,
Self: Sized,
Copies self into a StaticVecUnion.
sourcefn static_backend<B: Backend<T> + Default>(
self
) -> WithStaticBackend<T, Self, B, LEN> where
Self: Sized,
fn static_backend<B: Backend<T> + Default>(
self
) -> WithStaticBackend<T, Self, B, LEN> where
Self: Sized,
Statically use B
as a backend for self.
sourcefn matrix<B: Backend<T>, const M: usize, const K: usize>(
self
) -> Matrix<T, Self, B, LEN, false, MatrixShape<M, K>> where
Self: Sized,
fn matrix<B: Backend<T>, const M: usize, const K: usize>(
self
) -> Matrix<T, Self, B, LEN, false, MatrixShape<M, K>> where
Self: Sized,
Return crate::tensor::Tensor
with shape crate::tensor::MatrixShape::<M, K>
.
sourcefn reshape<B: Backend<T>, S: Shape<NDIM>, const NDIM: usize>(
self,
shape: S,
backend: B
) -> Tensor<T, Self, B, NDIM, LEN, S> where
Self: Sized,
fn reshape<B: Backend<T>, S: Shape<NDIM>, const NDIM: usize>(
self,
shape: S,
backend: B
) -> Tensor<T, Self, B, NDIM, LEN, S> where
Self: Sized,
Example Read more