Skip to content
masterclass Buddy

Rust · Class

Vec

Vec is Rust’s contiguous, growable array. It stores one element type and tracks both its current length and available capacity.

Last updated

Since
1.0.0

Syntax

pub struct Vec<T, A = Global> where A: Allocator

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • vec!
  • Vec::new
  • Vec::with_capacity
  • Vec::len
  • Vec::capacity
  • Vec::get
  • Vec::get_mut
  • Vec::push

Source: Vec in std::vec - Rust. Checked 2026-11-03.