Struct index_ext::array::ArrayPrefix
source · pub struct ArrayPrefix<const N: usize>;
Expand description
A marker struct for statically sized range to (..n
).
This can make use of parameter deduction in many cases, for example if assigning the slice to a right hand side array pattern.
use index_ext::array::ArrayPrefix;
let [r, g, b] = buf[ArrayPrefix];
To slice off an array in the middle of a slice, utilize the common pattern of indexing twice.
use index_ext::array::ArrayPrefix;
let [u, v] = buf[1..][ArrayPrefix];
Trait Implementations§
Auto Trait Implementations§
impl<const N: usize> RefUnwindSafe for ArrayPrefix<N>
impl<const N: usize> Send for ArrayPrefix<N>
impl<const N: usize> Sync for ArrayPrefix<N>
impl<const N: usize> Unpin for ArrayPrefix<N>
impl<const N: usize> UnwindSafe for ArrayPrefix<N>
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