Struct Vec
pub struct Vec<T>
{ /* private fields */ }
Implementations
impl<T> Vec<T>
pub fn new() -> Self
👎
Deprecated: std::collections::vec::Vec is deprecated, use the built-in vector type instead
pub fn from_vector(vector: [T]) -> Self
👎
Deprecated: std::collections::vec::Vec is deprecated, use the built-in vector type instead
pub fn get(self, index: u32) -> T
👎
Deprecated: std::collections::vec::Vec is deprecated, use the built-in vector type instead
pub fn set(&mut self, index: u32, value: T)
👎
Deprecated: std::collections::vec::Vec is deprecated, use the built-in vector type instead
Write an element to the vector at the given index.
Panics if the given index points beyond the end of the vector (self.len()).
pub fn push(&mut self, elem: T)
👎
Deprecated: std::collections::vec::Vec is deprecated, use the built-in vector type instead
Push a new element to the end of the vector, returning a new vector with a length one greater than the original unmodified vector.
pub fn pop(&mut self) -> T
👎
Deprecated: std::collections::vec::Vec is deprecated, use the built-in vector type instead
Pop an element from the end of the given vector, returning a new vector with a length of one less than the given vector, as well as the popped element. Panics if the given vector's length is zero.
pub fn insert(&mut self, index: u32, elem: T)
👎
Deprecated: std::collections::vec::Vec is deprecated, use the built-in vector type instead
Insert an element at a specified index, shifting all elements after it to the right
pub fn remove(&mut self, index: u32) -> T
👎
Deprecated: std::collections::vec::Vec is deprecated, use the built-in vector type instead
Remove an element at a specified index, shifting all elements after it to the left, returning the removed element
pub fn len(self) -> u32
👎
Deprecated: std::collections::vec::Vec is deprecated, use the built-in vector type instead
Returns the number of elements in the vector
Get an element from the vector at the given index. Panics if the given index points beyond the end of the vector.