pub type DynamicArray<T> = Vec<T>;Expand description
Dynamic array with contiguous memory layout
Complexity:
- Access: O(1) by index
- Push: O(1) amortized (doubles capacity on realloc)
- Insert/Remove: O(n) for arbitrary position
Memory: ptr + len + capacity (24 bytes on 64-bit)
Growth strategy: Geometric progression (2x) for amortized O(1)
Aliased Type§
pub struct DynamicArray<T> { /* private fields */ }Trait Implementations§
Source§impl<T> DynamicArrayExt<T> for DynamicArray<T>
impl<T> DynamicArrayExt<T> for DynamicArray<T>
Source§fn reserve_exact_fast(&mut self, additional: usize)
fn reserve_exact_fast(&mut self, additional: usize)
Reserve exact capacity without over-allocating
Source§fn extend_from_slice_fast(&mut self, slice: &[T])where
T: Clone,
fn extend_from_slice_fast(&mut self, slice: &[T])where
T: Clone,
Extend from slice with capacity pre-check
Source§fn clear_and_resize(&mut self, new_capacity: usize)
fn clear_and_resize(&mut self, new_capacity: usize)
Clear and set to specific capacity