[][src]Struct array_vec::ArrayVec

pub struct ArrayVec<T, const N: usize> { /* fields omitted */ }

An array backed fixed capcity vector

Methods

impl<T: Clone, const N: usize> ArrayVec<T, { N }>[src]

pub fn extend_from_slice(&mut self, slice: &[T])[src]

impl<T, const N: usize> ArrayVec<T, { N }>[src]

pub fn as_ptr(&self) -> *const T[src]

The pointer to the start of the array, only valid to read for self.len() elements

This pointer is not valid to write to, use as_mut_ptr instead

pub fn as_mut_ptr(&mut self) -> *mut T[src]

The pointer to the start of the array, only valid to read for self.len() elements, and to write for N elements

pub fn as_slice(&self) -> &[T][src]

As a shared reference to a slice

pub fn as_mut_slice(&mut self) -> &mut [T][src]

As a unique reference to a slice

pub fn push(&mut self, value: T) -> Result<(), T>[src]

Puts an element onto the end of the ArrayVec

pub fn insert(&mut self, value: T, index: usize) -> Result<(), T>[src]

Insert a single element into the ArrayVec at the given index

pub fn pop(&mut self) -> Option<T>[src]

Removes the last element from the ArrayVec

pub fn push_array<const M: usize>(
    &mut self,
    array: [T; M]
) -> Result<(), [T; M]>
[src]

Put all of the elements of the array into the end of the ArrayVec

pub fn insert_array<const M: usize>(
    &mut self,
    arr: [T; M],
    index: usize
) -> Result<(), [T; M]>
[src]

Insert all of the elements of the array into the ArrayVec at the given index

pub fn pop_array<const M: usize>(&mut self) -> Option<[T; M]>[src]

Pop the last M elements of the array at once

pub fn len(&self) -> usize[src]

The length of the ArrayVec

pub fn clear(&mut self)[src]

Removes all elements from the ArrayVec

pub fn into_array(self) -> [T; N][src]

Convert to an array, panics if the ArrayVec is not full

pub unsafe fn into_array_unchecked(self) -> [T; N][src]

Convert to an array, not checked in release mode and will panic in debug mode

Trait Implementations

impl<T, const N: usize> Extend<T> for ArrayVec<T, { N }>[src]

impl<T, const N: usize> Default for ArrayVec<T, { N }>[src]

Creates a new empty array

impl<T, const N: usize> Drop for ArrayVec<T, { N }>[src]

impl<T: PartialEq, const N: usize, const M: usize> PartialEq<ArrayVec<T, M>> for ArrayVec<T, { N }>[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl<T: Clone, const N: usize> Clone for ArrayVec<T, { N }>[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<T: PartialOrd, const N: usize, const M: usize> PartialOrd<ArrayVec<T, M>> for ArrayVec<T, { N }>[src]

#[must_use] fn lt(&self, other: &Rhs) -> bool1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use] fn le(&self, other: &Rhs) -> bool1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use] fn gt(&self, other: &Rhs) -> bool1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use] fn ge(&self, other: &Rhs) -> bool1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<T: Ord, const N: usize> Ord for ArrayVec<T, { N }>[src]

fn max(self, other: Self) -> Self1.21.0[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self1.21.0[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Restrict a value to a certain interval. Read more

impl<T, const N: usize> From<[T; N]> for ArrayVec<T, { N }>[src]

impl<T, const N: usize> IntoIterator for ArrayVec<T, { N }>[src]

type Item = T

The type of the elements being iterated over.

type IntoIter = IntoIter<T, { N }>

Which kind of iterator are we turning this into?

impl<'a, T, const N: usize> IntoIterator for &'a mut ArrayVec<T, { N }>[src]

type Item = &'a mut T

The type of the elements being iterated over.

type IntoIter = IterMut<'a, T>

Which kind of iterator are we turning this into?

impl<'a, T, const N: usize> IntoIterator for &'a ArrayVec<T, { N }>[src]

type Item = &'a T

The type of the elements being iterated over.

type IntoIter = Iter<'a, T>

Which kind of iterator are we turning this into?

impl<T: Eq, const N: usize> Eq for ArrayVec<T, { N }>[src]

impl<T: Hash, const N: usize> Hash for ArrayVec<T, { N }>[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl<T, const N: usize> Deref for ArrayVec<T, { N }>[src]

type Target = [T]

The resulting type after dereferencing.

impl<T, const N: usize> DerefMut for ArrayVec<T, { N }>[src]

impl<T, const N: usize> FromIterator<T> for ArrayVec<T, { N }>[src]

impl<T, const N: usize> TryInto<[T; N]> for ArrayVec<T, { N }>[src]

type Error = Self

The type returned in the event of a conversion error.

Auto Trait Implementations

impl<const N: usize, T> Unpin for ArrayVec<T, N> where
    T: Unpin

impl<const N: usize, T> Send for ArrayVec<T, N> where
    T: Send

impl<const N: usize, T> Sync for ArrayVec<T, N> where
    T: Sync

impl<const N: usize, T> UnwindSafe for ArrayVec<T, N> where
    T: UnwindSafe

impl<const N: usize, T> RefUnwindSafe for ArrayVec<T, N> where
    T: RefUnwindSafe

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]