Trait core::slice::SliceExtUnstable [-]  [+] [src]

pub trait SliceExt {
    type Item;

    fn slice<'a>(&'a self, start: usize, end: usize) -> &'a [Item];
    fn slice_from<'a>(&'a self, start: usize) -> &'a [Item];
    fn slice_to<'a>(&'a self, end: usize) -> &'a [Item];
    fn split_at<'a>(&'a self, mid: usize) -> (&'a [Item], &'a [Item]);
    fn iter<'a>(&'a self) -> Iter<'a, Item>;
    fn split<'a, P>(&'a self, pred: P) -> Split<'a, Item, P> where P: FnMut(&Item) -> bool;
    fn splitn<'a, P>(&'a self, n: usize, pred: P) -> SplitN<'a, Item, P> where P: FnMut(&Item) -> bool;
    fn rsplitn<'a, P>(&'a self, n: usize, pred: P) -> RSplitN<'a, Item, P> where P: FnMut(&Item) -> bool;
    fn windows<'a>(&'a self, size: usize) -> Windows<'a, Item>;
    fn chunks<'a>(&'a self, size: usize) -> Chunks<'a, Item>;
    fn get<'a>(&'a self, index: usize) -> Option<&'a Item>;
    fn first<'a>(&'a self) -> Option<&'a Item>;
    fn tail<'a>(&'a self) -> &'a [Item];
    fn init<'a>(&'a self) -> &'a [Item];
    fn last<'a>(&'a self) -> Option<&'a Item>;
    unsafe fn get_unchecked<'a>(&'a self, index: usize) -> &'a Item;
    fn as_ptr(&self) -> *const Item;
    fn binary_search_by<F>(&self, f: F) -> Result<usize, usize> where F: FnMut(&Item) -> Ordering;
    fn len(&self) -> usize;
    fn get_mut<'a>(&'a mut self, index: usize) -> Option<&'a mut Item>;
    fn as_mut_slice<'a>(&'a mut self) -> &'a mut [Item];
    fn slice_mut<'a>(&'a mut self, start: usize, end: usize) -> &'a mut [Item];
    fn slice_from_mut<'a>(&'a mut self, start: usize) -> &'a mut [Item];
    fn slice_to_mut<'a>(&'a mut self, end: usize) -> &'a mut [Item];
    fn iter_mut<'a>(&'a mut self) -> IterMut<'a, Item>;
    fn first_mut<'a>(&'a mut self) -> Option<&'a mut Item>;
    fn tail_mut<'a>(&'a mut self) -> &'a mut [Item];
    fn init_mut<'a>(&'a mut self) -> &'a mut [Item];
    fn last_mut<'a>(&'a mut self) -> Option<&'a mut Item>;
    fn split_mut<'a, P>(&'a mut self, pred: P) -> SplitMut<'a, Item, P> where P: FnMut(&Item) -> bool;
    fn splitn_mut<P>(&mut self, n: usize, pred: P) -> SplitNMut<Item, P> where P: FnMut(&Item) -> bool;
    fn rsplitn_mut<P>(&mut self, n: usize, pred: P) -> RSplitNMut<Item, P> where P: FnMut(&Item) -> bool;
    fn chunks_mut<'a>(&'a mut self, chunk_size: usize) -> ChunksMut<'a, Item>;
    fn swap(&mut self, a: usize, b: usize);
    fn split_at_mut<'a>(&'a mut self, mid: usize) -> (&'a mut [Item], &'a mut [Item]);
    fn reverse(&mut self);
    unsafe fn get_unchecked_mut<'a>(&'a mut self, index: usize) -> &'a mut Item;
    fn as_mut_ptr(&mut self) -> *mut Item;
    fn position_elem(&self, t: &Item) -> Option<usize> where Item: PartialEq;
    fn rposition_elem(&self, t: &Item) -> Option<usize> where Item: PartialEq;
    fn contains(&self, x: &Item) -> bool where Item: PartialEq;
    fn starts_with(&self, needle: &[Item]) -> bool where Item: PartialEq;
    fn ends_with(&self, needle: &[Item]) -> bool where Item: PartialEq;
    fn binary_search(&self, x: &Item) -> Result<usize, usize> where Item: Ord;
    fn next_permutation(&mut self) -> bool where Item: Ord;
    fn prev_permutation(&mut self) -> bool where Item: Ord;
    fn clone_from_slice(&mut self, &[Item]) -> usize where Item: Clone;

    fn is_empty(&self) -> bool { ... }
}

Extension methods for slices.

Associated Types

type Item

Required Methods

fn slice<'a>(&'a self, start: usize, end: usize) -> &'a [Item]

fn slice_from<'a>(&'a self, start: usize) -> &'a [Item]

fn slice_to<'a>(&'a self, end: usize) -> &'a [Item]

fn split_at<'a>(&'a self, mid: usize) -> (&'a [Item], &'a [Item])

fn iter<'a>(&'a self) -> Iter<'a, Item>

fn split<'a, P>(&'a self, pred: P) -> Split<'a, Item, P> where P: FnMut(&Item) -> bool

fn splitn<'a, P>(&'a self, n: usize, pred: P) -> SplitN<'a, Item, P> where P: FnMut(&Item) -> bool

fn rsplitn<'a, P>(&'a self, n: usize, pred: P) -> RSplitN<'a, Item, P> where P: FnMut(&Item) -> bool

fn windows<'a>(&'a self, size: usize) -> Windows<'a, Item>

fn chunks<'a>(&'a self, size: usize) -> Chunks<'a, Item>

fn get<'a>(&'a self, index: usize) -> Option<&'a Item>

fn first<'a>(&'a self) -> Option<&'a Item>

fn tail<'a>(&'a self) -> &'a [Item]

fn init<'a>(&'a self) -> &'a [Item]

fn last<'a>(&'a self) -> Option<&'a Item>

unsafe fn get_unchecked<'a>(&'a self, index: usize) -> &'a Item

fn as_ptr(&self) -> *const Item

fn binary_search_by<F>(&self, f: F) -> Result<usize, usize> where F: FnMut(&Item) -> Ordering

fn len(&self) -> usize

fn get_mut<'a>(&'a mut self, index: usize) -> Option<&'a mut Item>

fn as_mut_slice<'a>(&'a mut self) -> &'a mut [Item]

fn slice_mut<'a>(&'a mut self, start: usize, end: usize) -> &'a mut [Item]

fn slice_from_mut<'a>(&'a mut self, start: usize) -> &'a mut [Item]

fn slice_to_mut<'a>(&'a mut self, end: usize) -> &'a mut [Item]

fn iter_mut<'a>(&'a mut self) -> IterMut<'a, Item>

fn first_mut<'a>(&'a mut self) -> Option<&'a mut Item>

fn tail_mut<'a>(&'a mut self) -> &'a mut [Item]

fn init_mut<'a>(&'a mut self) -> &'a mut [Item]

fn last_mut<'a>(&'a mut self) -> Option<&'a mut Item>

fn split_mut<'a, P>(&'a mut self, pred: P) -> SplitMut<'a, Item, P> where P: FnMut(&Item) -> bool

fn splitn_mut<P>(&mut self, n: usize, pred: P) -> SplitNMut<Item, P> where P: FnMut(&Item) -> bool

fn rsplitn_mut<P>(&mut self, n: usize, pred: P) -> RSplitNMut<Item, P> where P: FnMut(&Item) -> bool

fn chunks_mut<'a>(&'a mut self, chunk_size: usize) -> ChunksMut<'a, Item>

fn swap(&mut self, a: usize, b: usize)

fn split_at_mut<'a>(&'a mut self, mid: usize) -> (&'a mut [Item], &'a mut [Item])

fn reverse(&mut self)

unsafe fn get_unchecked_mut<'a>(&'a mut self, index: usize) -> &'a mut Item

fn as_mut_ptr(&mut self) -> *mut Item

fn position_elem(&self, t: &Item) -> Option<usize> where Item: PartialEq

fn rposition_elem(&self, t: &Item) -> Option<usize> where Item: PartialEq

fn contains(&self, x: &Item) -> bool where Item: PartialEq

fn starts_with(&self, needle: &[Item]) -> bool where Item: PartialEq

fn ends_with(&self, needle: &[Item]) -> bool where Item: PartialEq

fn next_permutation(&mut self) -> bool where Item: Ord

fn prev_permutation(&mut self) -> bool where Item: Ord

fn clone_from_slice(&mut self, &[Item]) -> usize where Item: Clone

Provided Methods

fn is_empty(&self) -> bool

Implementors