Trait std::vec::MutableVector

pub trait MutableVector<'self, T> {
    fn mut_slice(self, start: uint, end: uint) -> &'self mut [T];
    fn mut_slice_from(self, start: uint) -> &'self mut [T];
    fn mut_slice_to(self, end: uint) -> &'self mut [T];
    fn mut_iter(self) -> VecMutIterator<'self, T>;
    fn mut_rev_iter(self) -> MutRevIterator<'self, T>;
    fn swap(self, a: uint, b: uint);
    fn mut_split(self, mid: uint) -> (&'self mut [T], &'self mut [T]);
    fn reverse(self);
    fn move_from(self, src: ~[T], start: uint, end: uint) -> uint;
    unsafe fn unsafe_mut_ref(self, index: uint) -> *mut T;
    unsafe fn unsafe_set(self, index: uint, val: T);
    fn as_mut_buf<U>(self, f: &fn(*mut T, uint) -> U) -> U;
}

Required Methods

fn mut_slice(self, start: uint, end: uint) -> &'self mut [T]

fn mut_slice_from(self, start: uint) -> &'self mut [T]

fn mut_slice_to(self, end: uint) -> &'self mut [T]

fn mut_iter(self) -> VecMutIterator<'self, T>

fn mut_rev_iter(self) -> MutRevIterator<'self, T>

fn swap(self, a: uint, b: uint)

fn mut_split(self, mid: uint) -> (&'self mut [T], &'self mut [T])

Divides one &mut into two. The first will contain all indices from 0..mid (excluding the index mid itself) and the second will contain all indices from mid..len (excluding the index len itself).

fn reverse(self)

fn move_from(self, src: ~[T], start: uint, end: uint) -> uint

Consumes src and moves as many elements as it can into self from the range [start,end).

Returns the number of elements copied (the shorter of self.len() and end - start).

Arguments

  • src - A mutable vector of T
  • start - The index into src to start copying from
  • end - The index into str to stop copying from

unsafe fn unsafe_mut_ref(self, index: uint) -> *mut T

unsafe fn unsafe_set(self, index: uint, val: T)

fn as_mut_buf<U>(self, f: &fn(*mut T, uint) -> U) -> U

Implementors