Struct DynArray

Source
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>

Source

pub fn new() -> Self

Source

pub fn new_with_capacity(cap: usize) -> Self

Pre-allocate for quicker operations

Source

pub fn size(&mut self, val: T)

Warning: Unimplemented Returns the current number of elements in the list.

Source

pub fn cap(&mut self, val: T)

Warning: Unimplemented Returns the current capacity of the list.

Source

pub fn is_empty(&mut self, val: T) -> bool

Warning: Unimplemented Returns a Boolean indicating whether the list is empty.

Source

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.

Source

pub fn pop(&mut self)

Warning: Unimplemented Removes the last inserted element from the list.

Source

pub fn remove(&mut self, index: usize)

Warning: Unimplemented Removes an element at the ith index in the list.

Source

pub fn insert(&mut self, val: T, index: usize)

Warning: Unimplemented Inserts an element at a given index, forcing any remaining elements between i - list.len() to shift right. If the list is at capacity, the list automatically grows in O(n) time.

Source

pub fn get(&mut self, index: usize) -> Option<T>

Warning: Unimplemented Returns

Trait Implementations§

Source§

impl<T: Debug> Debug for DynArray<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T> Drop for DynArray<T>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<T> Index<usize> for DynArray<T>

Source§

type Output = T

The returned type after indexing.
Source§

fn index(&self, index: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<T> IndexMut<usize> for DynArray<T>

Source§

fn index_mut(&mut self, index: usize) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V