struct Vec

struct Vec<T> {
    ptr: &T,
    len: usize,
    capacity: usize,
}

Fields§

ptr: &T§len: usize§capacity: usize§

Functions§

fn append(self: &Vec, slice: &[T])§fn append_vec(self: &Vec, other: Vec)§fn as_ptr(self: &Vec) -> &T§fn as_slice(self: &Vec) -> &[T]§fn capacity(self: &Vec) -> usize§fn clear(self: &Vec, dropper: fn(T))§fn drop(self: Vec, dropper: fn(T))§fn from_raw_parts(ptr: &T, len: usize, capacity: usize) -> Vec§fn get(self: &Vec, index: usize) -> T§fn insert(self: &Vec, index: usize, element: T)§fn into_raw_parts(self: Vec) -> (&T, usize, usize)§
Expand

Decomposes a Vec<T> into its raw components: (pointer, length, capacity).

fn is_empty(self: &Vec) -> bool§fn leak(self: Vec) -> &[T]§fn len(self: &Vec) -> usize§fn new() -> Vec§fn pop(self: &Vec) -> T§fn push(self: &Vec, v: T)§fn remove(self: &Vec, index: usize) -> T§fn reserve(self: &Vec, cap: usize)§fn retain(self: &Vec, f: fn(&T) -> bool, dropper: fn(T))§fn shrink_to(self: &Vec, min_capacity: usize)§
Expand

Shrinks the allocation of this vector to the smallest possible size to store all the elements (effectively sets capacity to max(min_capacity, length)).

fn shrink_to_fit(self: &Vec)§
Expand

Shrinks the allocation of this vector to the smallest possible size to store all the elements (effectively sets capacity to length).

fn swap_remove(self: &Vec, index: usize) -> T§fn truncate(self: &Vec, max_length: usize, dropper: fn(T))§fn unsafe_set_len(self: &Vec, new_len: usize)§
Expand

This is an unsafe operation. Usually changing the length should be done with push, pop, truncate, etc

fn with_capacity(capacity: usize) -> Vec§