pub trait RemovePrefix {
// Required method
fn remove_prefix(&mut self, n: usize);
}Expand description
A helper trait used to help implement the Subset. This trait allows abstract collections to remove a number of elements from the beginning, which is what we need for subsets.
Required Methods§
Sourcefn remove_prefix(&mut self, n: usize)
fn remove_prefix(&mut self, n: usize)
Remove n elements from the beginning.
Implementations on Foreign Types§
Source§impl<S: RemovePrefix, T: RemovePrefix> RemovePrefix for (S, T)
impl<S: RemovePrefix, T: RemovePrefix> RemovePrefix for (S, T)
fn remove_prefix(&mut self, n: usize)
Source§impl<T> RemovePrefix for &[T]
impl<T> RemovePrefix for &[T]
fn remove_prefix(&mut self, n: usize)
Source§impl<T> RemovePrefix for &mut [T]
impl<T> RemovePrefix for &mut [T]
Source§fn remove_prefix(&mut self, n: usize)
fn remove_prefix(&mut self, n: usize)
Remove a prefix of size n from this mutable slice.
§Example
use flatk::*;
let mut v = vec![1,2,3,4,5];
let mut s = v.as_mut_slice();
s.remove_prefix(2);
assert_eq!(&[3,4,5], s);Source§impl<T> RemovePrefix for Vec<T>
impl<T> RemovePrefix for Vec<T>
fn remove_prefix(&mut self, n: usize)
Source§impl<T> RemovePrefix for Range<T>
impl<T> RemovePrefix for Range<T>
fn remove_prefix(&mut self, n: usize)
Implementors§
impl<O: RemovePrefix + Set> RemovePrefix for ClumpedOffsets<O>
impl<O: RemovePrefix + Set> RemovePrefix for Offsets<O>
impl<S, I: RemovePrefix> RemovePrefix for Select<S, I>
impl<S: RemovePrefix> RemovePrefix for ChunkedN<S>
impl<S: RemovePrefix, N: Unsigned> RemovePrefix for UniChunked<S, U<N>>
Required for building Subsets of UniChunked types.
impl<S: RemovePrefix, O: RemovePrefix + AsRef<[usize]>> RemovePrefix for Chunked<S, O>
Required for subsets of chunked collections.