pub struct NullVec<T, const LEN: usize>(_);Expand description
A zero sized struct that implements StaticVec. It will always panic when trying to access any data within it. You should generally never have to use this struct, it is only here to avoid performance loss in some cases where functions might expect an argument that ypu know will never be used.
use slas::prelude::*;
unsafe{ NullVec::<f32, 10>::new() };Implementations
Trait Implementations
sourceimpl<T, const LEN: usize> StaticVec<T, LEN> for NullVec<T, LEN>
impl<T, const LEN: usize> StaticVec<T, LEN> for NullVec<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, _: usize) -> &'a T
unsafe fn get_unchecked<'a>(&'a self, _: usize) -> &'a T
Indexing without bounds checking. Read more
sourceunsafe fn get_unchecked_mut<'a>(&'a mut self, _: usize) -> &'a mut T
unsafe fn get_unchecked_mut<'a>(&'a mut self, _: usize) -> &'a mut T
Same as Self::get_unchecked but mutable. Read more
sourcefn moo_owned(&self) -> StaticVecUnion<'static, T, LEN> where
T: Copy,
fn moo_owned(&self) -> StaticVecUnion<'static, T, LEN> where
T: Copy,
Copies self into a StaticVecUnion.
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 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
unsafe fn reshape_unchecked_ref_mut<'a, B: Backend<T>, S: Shape<NDIM>, const NDIM: usize>(
&'a mut self,
shape: S,
backend: B
) -> Tensor<T, &mut [T; LEN], B, NDIM, LEN, S> where
Self: Sized,
unsafe fn reshape_unchecked_ref<'a, B: Backend<T>, S: Shape<NDIM>, const NDIM: usize>(
&'a self,
shape: S,
backend: B
) -> Tensor<T, &[T; LEN], B, NDIM, LEN, S> where
Self: Sized,
Auto Trait Implementations
impl<T, const LEN: usize> RefUnwindSafe for NullVec<T, LEN> where
T: RefUnwindSafe,
impl<T, const LEN: usize> Send for NullVec<T, LEN> where
T: Send,
impl<T, const LEN: usize> Sync for NullVec<T, LEN> where
T: Sync,
impl<T, const LEN: usize> Unpin for NullVec<T, LEN> where
T: Unpin,
impl<T, const LEN: usize> UnwindSafe for NullVec<T, LEN> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more