SliceRepr
VecRepr
push
push_fast
push_slow
reserve
- Reserves capacity for exactly n
elements in the given vector.reserve_at_least
- Reserves capacity for at least n
elements in the given vector.set_len
- Sets the length of a vectorSliceRepr
type SliceRepr = vec::raw::SliceRepr
VecRepr
type VecRepr = vec::raw::VecRepr
push
fn push<T>(v: &mut @[const T], initval: T)
push_fast
fn push_fast<T>(v: &mut @[const T], initval: T)
push_slow
fn push_slow<T>(v: &mut @[const T], initval: T)
reserve
fn reserve<T>(v: &mut @[const T], n: uint)
Reserves capacity for exactly n
elements in the given vector.
If the capacity for v
is already equal to or greater than the requested capacity, then no action is taken.
reserve_at_least
fn reserve_at_least<T>(v: &mut @[const T], n: uint)
Reserves capacity for at least n
elements in the given vector.
This function will over-allocate in order to amortize the allocation costs in scenarios where the caller may need to repeatedly reserve additional space.
If the capacity for v
is already equal to or greater than the requested capacity, then no action is taken.
set_len
fn set_len<T>(v: @[const T], new_len: uint)
Sets the length of a vector
This will explicitly set the size of the vector, without actually modifing its buffers, so it is up to the caller to ensure that the vector is actually the specified size.