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; }
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).
T
src
to start copying fromstr
to stop copying fromunsafe 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
impl<'self, T> MutableVector<'self, T> for &'self mut [T]
Prefix searches with a type followed by a colon (e.g.
fn:
) to restrict the search to a given type.
Accepted types are: fn
, mod
,
struct
(or str
), enum
,
trait
, typedef
(or
tdef
).