RemovePrefix

Trait RemovePrefix 

Source
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§

Source

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)

Source§

fn remove_prefix(&mut self, n: usize)

Source§

impl<T> RemovePrefix for &[T]

Source§

fn remove_prefix(&mut self, n: usize)

Source§

impl<T> RemovePrefix for &mut [T]

Source§

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>

Source§

fn remove_prefix(&mut self, n: usize)

Source§

impl<T> RemovePrefix for Range<T>
where T: From<usize>,

Source§

fn remove_prefix(&mut self, n: usize)

Implementors§

Source§

impl<O: RemovePrefix + Set> RemovePrefix for ClumpedOffsets<O>

Source§

impl<O: RemovePrefix + Set> RemovePrefix for Offsets<O>

Source§

impl<S, I: RemovePrefix> RemovePrefix for Select<S, I>

Source§

impl<S: RemovePrefix> RemovePrefix for ChunkedN<S>

Source§

impl<S: RemovePrefix, N: Unsigned> RemovePrefix for UniChunked<S, U<N>>

Required for building Subsets of UniChunked types.

Source§

impl<S: RemovePrefix, O: RemovePrefix + AsRef<[usize]>> RemovePrefix for Chunked<S, O>

Required for subsets of chunked collections.

Source§

impl<S: RemovePrefix, T, I: RemovePrefix> RemovePrefix for Sparse<S, T, I>

Source§

impl<S: Set + RemovePrefix, I: RemovePrefix + AsRef<[usize]>> RemovePrefix for Subset<S, I>