[−][src]Struct array_vec::ArrayVec
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]
&mut self,
array: [T; M]
) -> Result<(), [T; M]>
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]
&mut self,
arr: [T; M],
index: usize
) -> Result<(), [T; M]>
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]
fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I)
[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]
fn eq(&self, other: &ArrayVec<T, { M }>) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<T: Clone, const N: usize> Clone for ArrayVec<T, { N }>
[src]
fn clone(&self) -> Self
[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]
fn partial_cmp(&self, other: &ArrayVec<T, { M }>) -> Option<Ordering>
[src]
#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.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) -> bool
1.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) -> bool
1.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) -> bool
1.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 cmp(&self, other: &Self) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
fn clamp(self, min: Self, max: Self) -> Self
[src]
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?
fn into_iter(self) -> Self::IntoIter
[src]
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?
fn into_iter(self) -> Self::IntoIter
[src]
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?
fn into_iter(self) -> Self::IntoIter
[src]
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<H: Hasher>(&self, state: &mut H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<T, const N: usize> Deref for ArrayVec<T, { N }>
[src]
impl<T, const N: usize> DerefMut for ArrayVec<T, { N }>
[src]
impl<T, const N: usize> FromIterator<T> for ArrayVec<T, { N }>
[src]
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
[src]
impl<T, const N: usize> TryInto<[T; N]> for ArrayVec<T, { N }>
[src]
Auto Trait Implementations
impl<const N: usize, T> Unpin for ArrayVec<T, N> where
T: Unpin,
T: Unpin,
impl<const N: usize, T> Send for ArrayVec<T, N> where
T: Send,
T: Send,
impl<const N: usize, T> Sync for ArrayVec<T, N> where
T: Sync,
T: Sync,
impl<const N: usize, T> UnwindSafe for ArrayVec<T, N> where
T: UnwindSafe,
T: UnwindSafe,
impl<const N: usize, T> RefUnwindSafe for ArrayVec<T, N> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
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?
fn into_iter(self) -> I
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,