pub struct DynamicArray<T> { /* private fields */ }Expand description
A dynamic array backed by a Vec.
Implementations§
Source§impl<T> DynamicArray<T>
impl<T> DynamicArray<T>
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Creates a new DynamicArray with the given capacity.
Sourcepub fn insert(&mut self, index: usize, value: T) -> Result<(), Error>
pub fn insert(&mut self, index: usize, value: T) -> Result<(), Error>
Inserts a value at the given index.
Sourcepub fn remove(&mut self, value: &T) -> Result<(), Error>where
T: PartialEq,
pub fn remove(&mut self, value: &T) -> Result<(), Error>where
T: PartialEq,
Removes the first occurrence of a value.
Trait Implementations§
Source§impl<T: Clone> Clone for DynamicArray<T>
impl<T: Clone> Clone for DynamicArray<T>
Source§impl<T: Debug> Debug for DynamicArray<T>
impl<T: Debug> Debug for DynamicArray<T>
Auto Trait Implementations§
impl<T> Freeze for DynamicArray<T>
impl<T> RefUnwindSafe for DynamicArray<T>where
Vec<T>: RefUnwindSafe,
impl<T> Send for DynamicArray<T>
impl<T> Sync for DynamicArray<T>
impl<T> Unpin for DynamicArray<T>
impl<T> UnsafeUnpin for DynamicArray<T>where
Vec<T>: UnsafeUnpin,
impl<T> UnwindSafe for DynamicArray<T>where
Vec<T>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more