Struct slas::backends::WithStaticBackend
source · [−]pub struct WithStaticBackend<T, U: StaticVec<T, LEN>, B: Backend<T>, const LEN: usize> {
pub data: U,
pub backend: B,
pub _pd: PhantomData<T>,
}Expand description
Perform opertaions on a StaticVec with a static backend.
Fields
data: Ubackend: B_pd: PhantomData<T>Implementations
sourceimpl<T, U: StaticVec<T, LEN>, B: Backend<T>, const LEN: usize> WithStaticBackend<T, U, B, LEN>
impl<T, U: StaticVec<T, LEN>, B: Backend<T>, const LEN: usize> WithStaticBackend<T, U, B, LEN>
pub const fn from_static_vec(v: U, b: B) -> Self
sourceimpl<T, U: StaticVec<T, LEN>, B: Backend<T>, const LEN: usize> WithStaticBackend<T, U, B, LEN>
impl<T, U: StaticVec<T, LEN>, B: Backend<T>, const LEN: usize> WithStaticBackend<T, U, B, LEN>
sourceimpl<T, U: StaticVec<T, LEN>, B: Backend<T> + DotProduct<T, DotOutput = T>, const LEN: usize> WithStaticBackend<T, U, B, LEN>
impl<T, U: StaticVec<T, LEN>, B: Backend<T> + DotProduct<T, DotOutput = T>, const LEN: usize> WithStaticBackend<T, U, B, LEN>
pub fn dot<U2: StaticVec<T, LEN>>(
&self,
other: &WithStaticBackend<T, U2, B, LEN>
) -> T
Trait Implementations
sourceimpl<T: Clone, U: Clone + StaticVec<T, LEN>, B: Clone + Backend<T>, const LEN: usize> Clone for WithStaticBackend<T, U, B, LEN>
impl<T: Clone, U: Clone + StaticVec<T, LEN>, B: Clone + Backend<T>, const LEN: usize> Clone for WithStaticBackend<T, U, B, LEN>
sourcefn clone(&self) -> WithStaticBackend<T, U, B, LEN>
fn clone(&self) -> WithStaticBackend<T, U, B, LEN>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl<T, U: StaticVec<T, LEN>, B: Backend<T>, const LEN: usize> Deref for WithStaticBackend<T, U, B, LEN>
impl<T, U: StaticVec<T, LEN>, B: Backend<T>, const LEN: usize> Deref for WithStaticBackend<T, U, B, LEN>
sourceimpl<T, U: StaticVec<T, LEN>, B: Backend<T>, const LEN: usize> DerefMut for WithStaticBackend<T, U, B, LEN>
impl<T, U: StaticVec<T, LEN>, B: Backend<T>, const LEN: usize> DerefMut for WithStaticBackend<T, U, B, LEN>
sourceimpl<T, U: StaticVec<T, LEN>, B: Backend<T>, const LEN: usize> StaticVec<T, LEN> for WithStaticBackend<T, U, B, LEN>
impl<T, U: StaticVec<T, LEN>, B: Backend<T>, const LEN: usize> StaticVec<T, LEN> for WithStaticBackend<T, U, B, 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
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,
impl<T: Copy, U: Copy + StaticVec<T, LEN>, B: Copy + Backend<T>, const LEN: usize> Copy for WithStaticBackend<T, U, B, LEN>
Auto Trait Implementations
impl<T, U, B, const LEN: usize> RefUnwindSafe for WithStaticBackend<T, U, B, LEN> where
B: RefUnwindSafe,
T: RefUnwindSafe,
U: RefUnwindSafe,
impl<T, U, B, const LEN: usize> Send for WithStaticBackend<T, U, B, LEN> where
B: Send,
T: Send,
U: Send,
impl<T, U, B, const LEN: usize> Sync for WithStaticBackend<T, U, B, LEN> where
B: Sync,
T: Sync,
U: Sync,
impl<T, U, B, const LEN: usize> Unpin for WithStaticBackend<T, U, B, LEN> where
B: Unpin,
T: Unpin,
U: Unpin,
impl<T, U, B, const LEN: usize> UnwindSafe for WithStaticBackend<T, U, B, LEN> where
B: UnwindSafe,
T: UnwindSafe,
U: 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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more