Skip to main content

Array

Struct Array 

Source
pub struct Array<Type, const N: usize> { /* private fields */ }

Implementations§

Source§

impl<Type, const N: usize> Array<Type, N>

Source

pub const fn capacity(&self) -> usize

Source

pub const fn is_empty(&self) -> bool

Source

pub const fn new() -> Self

Source

pub const fn len(&self) -> usize

Source

pub const fn push(&mut self, value: Type)

Source

pub const fn pop(&mut self) -> Option<Type>

Source

pub fn clear(&mut self)

Source

pub const fn get<'valid>(&'valid self, index: usize) -> Option<&'valid Type>

Source

pub const fn get_mut<'valid>( &'valid mut self, index: usize, ) -> Option<&'valid mut Type>

Source

pub const fn insert(&mut self, index: usize, value: Type)

Source

pub const fn remove(&mut self, index: usize) -> Type

Source

pub const fn iter<'valid>(&'valid self) -> Iter<'valid, Type>

Source

pub const fn iter_mut<'valid>(&'valid mut self) -> IterMut<'valid, Type>

Trait Implementations§

Source§

impl<Type, const N: usize> AsMut<[Type]> for Array<Type, N>

Source§

fn as_mut(&mut self) -> &mut [Type]

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl<Type, const N: usize> AsRef<[Type]> for Array<Type, N>

Source§

fn as_ref(&self) -> &[Type]

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<Type, const N: usize> Borrow<[Type]> for Array<Type, N>

Source§

fn borrow(&self) -> &[Type]

Immutably borrows from an owned value. Read more
Source§

impl<Type, const N: usize> BorrowMut<[Type]> for Array<Type, N>

Source§

fn borrow_mut(&mut self) -> &mut [Type]

Mutably borrows from an owned value. Read more
Source§

impl<Type: Clone, const N: usize> Clone for Array<Type, N>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Type: Debug, const N: usize> Debug for Array<Type, N>

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Format

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

impl<Type, const N: usize> Default for Array<Type, N>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<Type, const N: usize> Drop for Array<Type, N>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl<Type: Eq, const N: usize> Eq for Array<Type, N>

Source§

impl<Type, const N: usize> Extend<Type> for Array<Type, N>

Source§

fn extend<T: IntoIterator<Item = Type>>(&mut self, iter: T)

Extends a collection with the contents of an iterator. Read more
Source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Source§

impl<Type, const M: usize, const N: usize> From<[Type; N]> for Array<Type, M>

Source§

fn from(value: [Type; N]) -> Self

Converts to this type from the input type.
Source§

impl<Type, const N: usize> FromIterator<Type> for Array<Type, N>

Source§

fn from_iter<T: IntoIterator<Item = Type>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl<Type: Hash, const N: usize> Hash for Array<Type, N>

Source§

fn hash<Hashing: Hasher>(&self, state: &mut Hashing)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

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

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<Type, const N: usize> Index<Range<usize>> for Array<Type, N>

Source§

type Output = [Type]

The returned type after indexing.
Source§

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

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

impl<Type, const N: usize> Index<RangeFrom<usize>> for Array<Type, N>

Source§

type Output = [Type]

The returned type after indexing.
Source§

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

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

impl<Type, const N: usize> Index<RangeFull> for Array<Type, N>

Source§

type Output = [Type]

The returned type after indexing.
Source§

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

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

impl<Type, const N: usize> Index<RangeInclusive<usize>> for Array<Type, N>

Source§

type Output = [Type]

The returned type after indexing.
Source§

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

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

impl<Type, const N: usize> Index<RangeTo<usize>> for Array<Type, N>

Source§

type Output = [Type]

The returned type after indexing.
Source§

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

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

impl<Type, const N: usize> Index<RangeToInclusive<usize>> for Array<Type, N>

Source§

type Output = [Type]

The returned type after indexing.
Source§

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

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

impl<Type, const N: usize> Index<usize> for Array<Type, N>

Source§

type Output = Type

The returned type after indexing.
Source§

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

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

impl<Type, const N: usize> IndexMut<Range<usize>> for Array<Type, N>

Source§

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

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

impl<Type, const N: usize> IndexMut<RangeFrom<usize>> for Array<Type, N>

Source§

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

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

impl<Type, const N: usize> IndexMut<RangeFull> for Array<Type, N>

Source§

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

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

impl<Type, const N: usize> IndexMut<RangeInclusive<usize>> for Array<Type, N>

Source§

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

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

impl<Type, const N: usize> IndexMut<RangeTo<usize>> for Array<Type, N>

Source§

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

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

impl<Type, const N: usize> IndexMut<RangeToInclusive<usize>> for Array<Type, N>

Source§

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

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

impl<Type, const N: usize> IndexMut<usize> for Array<Type, N>

Source§

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

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

impl<Type, const N: usize> Into<Vec<Type>> for Array<Type, N>

Source§

fn into(self) -> Vec<Type>

Converts this type into the (usually inferred) input type.
Source§

impl<Type, const N: usize> IntoIterator for Array<Type, N>

Source§

type Item = Type

The type of the elements being iterated over.
Source§

type IntoIter = Iterable<Type, N>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'valid, Type, const N: usize> IntoIterator for &'valid Array<Type, N>

Source§

type Item = &'valid Type

The type of the elements being iterated over.
Source§

type IntoIter = Iter<'valid, Type>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'valid, Type, const N: usize> IntoIterator for &'valid mut Array<Type, N>

Source§

type Item = &'valid mut Type

The type of the elements being iterated over.
Source§

type IntoIter = IterMut<'valid, Type>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<Type: Ord, const N: usize> Ord for Array<Type, N>

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<Type: PartialEq, const N: usize> PartialEq for Array<Type, N>

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<Type: PartialOrd, const N: usize> PartialOrd for Array<Type, N>

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

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

Auto Trait Implementations§

§

impl<Type, const N: usize> Freeze for Array<Type, N>
where Type: Freeze,

§

impl<Type, const N: usize> RefUnwindSafe for Array<Type, N>
where Type: RefUnwindSafe,

§

impl<Type, const N: usize> Send for Array<Type, N>
where Type: Send,

§

impl<Type, const N: usize> Sync for Array<Type, N>
where Type: Sync,

§

impl<Type, const N: usize> Unpin for Array<Type, N>
where Type: Unpin,

§

impl<Type, const N: usize> UnsafeUnpin for Array<Type, N>
where Type: UnsafeUnpin,

§

impl<Type, const N: usize> UnwindSafe for Array<Type, N>
where Type: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.