Back to Developer Roadmap

Vector

src/data/roadmaps/rust/content/[email protected]

4.0868 B
Original Source

Vector

Vec<T> is Rust's growable, heap-allocated array that stores elements of the same type contiguously. Unlike arrays, vectors can resize at runtime. Key methods include push() to add elements, pop() to remove the last element, and len() for size. Example: let mut v = vec![1, 2, 3];

Visit the following resources to learn more: