Skip to content
masterclass Buddy

Rust · Method

Vec::push

Vec::push adds one value to the end of a mutable Vec. The vector grows when needed.

Last updated

Syntax

pub fn push(&mut self, value: T)

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

Subscribe
  • Vec
  • Vec::new
  • vec!
  • Vec::pop
  • Vec::len

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