pub struct VecMut<'a, T> { /* private fields */ }Expand description
mutable vector type
Implementations§
Source§impl<'a, T> VecMut<'a, T>
impl<'a, T> VecMut<'a, T>
Sourcepub fn slice(&self, range: Range<usize>) -> &[T]
pub fn slice(&self, range: Range<usize>) -> &[T]
accesses internal immutable slice over a given index range
Sourcepub fn slice_mut(&mut self, range: Range<usize>) -> &mut [T]
pub fn slice_mut(&mut self, range: Range<usize>) -> &mut [T]
accesses internal mutable slice over a given index range
Sourcepub fn as_slice_mut(&mut self) -> &mut [T]
pub fn as_slice_mut(&mut self) -> &mut [T]
accesses full internal slice as mutable
Sourcepub fn has_equal_length(&self, length: usize) -> bool
pub fn has_equal_length(&self, length: usize) -> bool
checks whether internal length is equal to given length parameter
Sourcepub fn reborrow(&mut self) -> VecMut<'_, T>
pub fn reborrow(&mut self) -> VecMut<'_, T>
used for calling routines over and over again on the stored internal mutable slice
borrows self mutably
example:
use lak::l1::scal;
use lak::types::VecMut;
let mut x = [1.0, 2.0, 3.0];
let mut x = VecMut::new(&mut x);
scal(2.0, x.reborrow());
scal(3.0, x.reborrow());Trait Implementations§
Auto Trait Implementations§
impl<'a, T> !UnwindSafe for VecMut<'a, T>
impl<'a, T> Freeze for VecMut<'a, T>
impl<'a, T> RefUnwindSafe for VecMut<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for VecMut<'a, T>where
T: Send,
impl<'a, T> Sync for VecMut<'a, T>where
T: Sync,
impl<'a, T> Unpin for VecMut<'a, T>
impl<'a, T> UnsafeUnpin for VecMut<'a, T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more