pub struct DynArray<T> { /* private fields */ }Expand description
A dynamically sized, contiguous storage buffer with positive (forward) indexing, where elements are stored sequentially in memory.
Implementations§
Source§impl<T> DynArray<T>
impl<T> DynArray<T>
pub fn new() -> Self
Sourcepub fn new_with_capacity(cap: usize) -> Self
pub fn new_with_capacity(cap: usize) -> Self
Pre-allocate for quicker operations
Sourcepub fn size(&mut self, val: T)
pub fn size(&mut self, val: T)
Warning: Unimplemented Returns the current number of elements in the list.
Sourcepub fn is_empty(&mut self, val: T) -> bool
pub fn is_empty(&mut self, val: T) -> bool
Warning: Unimplemented Returns a Boolean indicating whether the list is empty.
Sourcepub fn push(&mut self, val: T)
pub fn push(&mut self, val: T)
Appends the list with an given element in O(1) time. If the list is at capacity, this operation automatically grows the list in O(n) time.
Sourcepub fn remove(&mut self, index: usize)
pub fn remove(&mut self, index: usize)
Warning: Unimplemented Removes an element at the ith index in the list.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for DynArray<T>
impl<T> RefUnwindSafe for DynArray<T>where
T: RefUnwindSafe,
impl<T> !Send for DynArray<T>
impl<T> !Sync for DynArray<T>
impl<T> Unpin for DynArray<T>
impl<T> UnwindSafe for DynArray<T>where
T: RefUnwindSafe,
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