doc.rust-lang.org
pub fn into_flattened(self) -> Vec<T, A>
Takes a Vec<[T; N]> and flattens it into a Vec<T>.
method
alloc
Stable since 1.80.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn into_boxed_slice(self) -> Box<[T], A>
Converts the vector into Box<[T]>.
method
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn insert_mut(&mut self, index: usize, element: T) -> &mut T
Inserts an element at position index within the vector, shifting all elements after it to the right, and returning a reference to the new element.
method
alloc
Stable since 1.95.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn insert(&mut self, index: usize, element: T)
Inserts an element at position index within the vector, shifting all elements after it to the right.
method
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn from_raw_parts(ptr: *mut T, length: usize, capacity: usize) -> Self
Creates a Vec<T> directly from a pointer, a length, and a capacity.
associated_function
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn from_parts(ptr: NonNull<T>, length: usize, capacity: usize) -> Self
Creates a Vec<T> directly from a NonNull pointer, a length, and a capacity.
associated_function
alloc
Stable since 1.100.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn extract_if<F, R>(&mut self, range: R, filter: F) -> ExtractIf<'_, T, F, A>
Creates an iterator which uses a closure to determine if an element in the range should be removed.
method
alloc
Stable since 1.87.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn extend_from_within<R>(&mut self, src: R)
Given a range src, clones a slice of elements in that range and appends it to the end.
method
alloc
Stable since 1.53.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn extend_from_slice(&mut self, other: &[T])
Clones and appends all elements in a slice to the Vec.
method
alloc
Stable since 1.6.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn drain<R>(&mut self, range: R) -> Drain<'_, T, A>
Removes the subslice indicated by the given range from the vector, returning a double-ended iterator over the removed subslice.
method
alloc
Stable since 1.6.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn dedup_by_key<F, K>(&mut self, key: F)
Removes all but the first of consecutive elements in the vector that resolve to the same key.
method
alloc
Stable since 1.16.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn dedup_by<F>(&mut self, same_bucket: F)
Removes all but the first of consecutive elements in the vector that are "equal" according to the given predicate function.
method
alloc
Stable since 1.16.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn dedup(&mut self)
Removes consecutive repeated elements in the vector according to the PartialEq trait implementation.
method
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn clear(&mut self)
Clears the vector, removing all values.
method
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn capacity(&self) -> usize
Returns the total number of elements the vector can hold without reallocating.
method
alloc
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn as_slice(&self) -> &[T]
Extracts a slice containing the entire vector.
method
alloc
Stable since 1.7.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn as_ptr(&self) -> *const T
Returns a raw pointer to the vector's buffer, or a dangling raw pointer valid for zero sized reads if the vector didn't allocate.
method
alloc
Stable since 1.37.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn as_mut_slice(&mut self) -> &mut [T]
Extracts a mutable slice of the entire vector.
method
alloc
Stable since 1.7.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn as_mut_ptr(&mut self) -> *mut T
Returns a raw mutable pointer to the vector's buffer, or a dangling raw pointer valid for zero sized reads if the vector didn't allocate.
method
alloc
Stable since 1.37.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn append(&mut self, other: &mut Self)
Moves all the elements of other into self, leaving other empty.
method
alloc
Stable since 1.4.0
Version 1.100.0-nightly