pub struct Overlapping<'a, V>where
V: Vector,{ /* private fields */ }
Expand description
Wrapper for indexing into overlapping vectors.
Implementations§
Source§impl<'a, V> Overlapping<'a, V>where
V: Vector,
impl<'a, V> Overlapping<'a, V>where
V: Vector,
Sourcepub fn new(token: impl Into<V::Token>, slice: &'a [V::Scalar]) -> Self
pub fn new(token: impl Into<V::Token>, slice: &'a [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) -> Vwhere
V: Vector,
pub unsafe fn get_unchecked(&self, index: usize) -> Vwhere
V: Vector,
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.
Auto Trait Implementations§
impl<'a, V> Freeze for Overlapping<'a, V>
impl<'a, V> RefUnwindSafe for Overlapping<'a, V>
impl<'a, V> Send for Overlapping<'a, V>
impl<'a, V> Sync for Overlapping<'a, V>
impl<'a, V> Unpin for Overlapping<'a, V>where
V: Unpin,
impl<'a, V> UnwindSafe for Overlapping<'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