pub struct OverlappingMut<'a, V>where
V: Vector,{ /* private fields */ }
Expand description
Wrapper for indexing into overlapping mutable vectors.
Implementations§
Source§impl<'a, V> OverlappingMut<'a, V>where
V: Vector,
impl<'a, V> OverlappingMut<'a, V>where
V: Vector,
Sourcepub fn new(token: impl Into<V::Token>, slice: &'a mut [V::Scalar]) -> Self
pub fn new(token: impl Into<V::Token>, slice: &'a mut [V::Scalar]) -> Self
Create a new overlapping vector slice.
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Returns the number of overlapping vectors.
Equal to slice.len() - V::width() + 1
.
Sourcepub fn get(&self, index: usize) -> Option<V>
pub fn get(&self, index: usize) -> Option<V>
Returns the vector offset index
into the slice of scalars.
Sourcepub unsafe fn get_unchecked(&self, index: usize) -> V
pub unsafe fn get_unchecked(&self, index: usize) -> V
Returns the vector offset index
into the slice of scalars.
§Safety
Index must be less than len()
, i.e. the underlying slice must be at least `index
- V::width()` long.
Sourcepub fn get_mut(&'a mut self, index: usize) -> Option<RefMut<'a, V>>
pub fn get_mut(&'a mut self, index: usize) -> Option<RefMut<'a, V>>
Returns the mutable vector offset index
into the slice of scalars.
Sourcepub unsafe fn get_unchecked_mut(&'a mut self, index: usize) -> RefMut<'a, V>
pub unsafe fn get_unchecked_mut(&'a mut self, index: usize) -> RefMut<'a, V>
Returns the mutable vector offset index
into the slice of scalars.
§Safety
Index must be less than len()
, i.e. the underlying slice must be at least `index
- V::width()` long.
Auto Trait Implementations§
impl<'a, V> Freeze for OverlappingMut<'a, V>
impl<'a, V> RefUnwindSafe for OverlappingMut<'a, V>
impl<'a, V> Send for OverlappingMut<'a, V>
impl<'a, V> Sync for OverlappingMut<'a, V>
impl<'a, V> Unpin for OverlappingMut<'a, V>where
V: Unpin,
impl<'a, V> !UnwindSafe for OverlappingMut<'a, V>
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