[][src]Trait flatk::RemovePrefix

pub trait RemovePrefix {
    fn remove_prefix(&mut self, n: usize);
}

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

fn remove_prefix(&mut self, n: usize)

Remove n elements from the beginning.

Loading content...

Implementations on Foreign Types

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

impl<'_, T> RemovePrefix for &'_ [T][src]

impl<'_, T> RemovePrefix for &'_ mut [T][src]

fn remove_prefix(&mut self, n: usize)[src]

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);

impl<S: RemovePrefix, T: RemovePrefix> RemovePrefix for (S, T)[src]

impl<T> RemovePrefix for Vec<T>[src]

Loading content...

Implementors

impl<O: RemovePrefix> RemovePrefix for Offsets<O>[src]

impl<O: RemovePrefix> RemovePrefix for SortedChunks<O>[src]

impl<S, I: RemovePrefix> RemovePrefix for Select<S, I>[src]

impl<S: RemovePrefix> RemovePrefix for ChunkedN<S>[src]

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

Required for building Subsets of UniChunked types.

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

Required for subsets of chunked collections.

fn remove_prefix(&mut self, n: usize)[src]

Remove a prefix of size n from a chunked collection.

Example

use flatk::*;
let mut s = Chunked::<Vec<usize>>::from_offsets(vec![0,1,4,6], vec![0,1,2,3,4,5]);
s.remove_prefix(2);
let mut iter = s.iter();
assert_eq!(Some(&[4,5][..]), iter.next());
assert_eq!(None, iter.next());

impl<S: RemovePrefix, T, I: RemovePrefix> RemovePrefix for Sparse<S, T, I>[src]

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

fn remove_prefix(&mut self, n: usize)[src]

This function will panic if n is larger than self.len().

Loading content...