Struct generic_array::GenericArray[][src]

#[repr(transparent)]pub struct GenericArray<T, U: ArrayLength<T>> { /* fields omitted */ }

Struct representing a generic array - GenericArray<T, N> works like [T; N]

Implementations

impl<T, N> GenericArray<T, N> where
    N: ArrayLength<T>, 
[src]

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

Extracts a slice containing the entire array.

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

Extracts a mutable slice containing the entire array.

pub fn from_slice(slice: &[T]) -> &GenericArray<T, N>[src]

Converts slice to a generic array reference with inferred length;

Length of the slice must be equal to the length of the array.

pub fn from_mut_slice(slice: &mut [T]) -> &mut GenericArray<T, N>[src]

Converts mutable slice to a mutable generic array reference

Length of the slice must be equal to the length of the array.

impl<T: Clone, N> GenericArray<T, N> where
    N: ArrayLength<T>, 
[src]

pub fn clone_from_slice(list: &[T]) -> GenericArray<T, N>[src]

Construct a GenericArray from a slice by cloning its content

Length of the slice must be equal to the length of the array

impl<T, N> GenericArray<T, N> where
    N: ArrayLength<T>, 
[src]

pub fn from_exact_iter<I>(iter: I) -> Option<Self> where
    I: IntoIterator<Item = T>, 
[src]

Creates a new GenericArray instance from an iterator with a specific size.

Returns None if the size is not equal to the number of elements in the GenericArray.

Trait Implementations

impl<T> AsMut<[T; 1]> for GenericArray<T, U1>[src]

impl<T> AsMut<[T; 10]> for GenericArray<T, U10>[src]

impl<T> AsMut<[T; 11]> for GenericArray<T, U11>[src]

impl<T> AsMut<[T; 12]> for GenericArray<T, U12>[src]

impl<T> AsMut<[T; 13]> for GenericArray<T, U13>[src]

impl<T> AsMut<[T; 14]> for GenericArray<T, U14>[src]

impl<T> AsMut<[T; 15]> for GenericArray<T, U15>[src]

impl<T> AsMut<[T; 16]> for GenericArray<T, U16>[src]

impl<T> AsMut<[T; 17]> for GenericArray<T, U17>[src]

impl<T> AsMut<[T; 18]> for GenericArray<T, U18>[src]

impl<T> AsMut<[T; 19]> for GenericArray<T, U19>[src]

impl<T> AsMut<[T; 2]> for GenericArray<T, U2>[src]

impl<T> AsMut<[T; 20]> for GenericArray<T, U20>[src]

impl<T> AsMut<[T; 21]> for GenericArray<T, U21>[src]

impl<T> AsMut<[T; 22]> for GenericArray<T, U22>[src]

impl<T> AsMut<[T; 23]> for GenericArray<T, U23>[src]

impl<T> AsMut<[T; 24]> for GenericArray<T, U24>[src]

impl<T> AsMut<[T; 25]> for GenericArray<T, U25>[src]

impl<T> AsMut<[T; 26]> for GenericArray<T, U26>[src]

impl<T> AsMut<[T; 27]> for GenericArray<T, U27>[src]

impl<T> AsMut<[T; 28]> for GenericArray<T, U28>[src]

impl<T> AsMut<[T; 29]> for GenericArray<T, U29>[src]

impl<T> AsMut<[T; 3]> for GenericArray<T, U3>[src]

impl<T> AsMut<[T; 30]> for GenericArray<T, U30>[src]

impl<T> AsMut<[T; 31]> for GenericArray<T, U31>[src]

impl<T> AsMut<[T; 32]> for GenericArray<T, U32>[src]

impl<T> AsMut<[T; 4]> for GenericArray<T, U4>[src]

impl<T> AsMut<[T; 5]> for GenericArray<T, U5>[src]

impl<T> AsMut<[T; 6]> for GenericArray<T, U6>[src]

impl<T> AsMut<[T; 7]> for GenericArray<T, U7>[src]

impl<T> AsMut<[T; 8]> for GenericArray<T, U8>[src]

impl<T> AsMut<[T; 9]> for GenericArray<T, U9>[src]

impl<T, N> AsMut<[T]> for GenericArray<T, N> where
    N: ArrayLength<T>, 
[src]

impl<T> AsRef<[T; 1]> for GenericArray<T, U1>[src]

impl<T> AsRef<[T; 10]> for GenericArray<T, U10>[src]

impl<T> AsRef<[T; 11]> for GenericArray<T, U11>[src]

impl<T> AsRef<[T; 12]> for GenericArray<T, U12>[src]

impl<T> AsRef<[T; 13]> for GenericArray<T, U13>[src]

impl<T> AsRef<[T; 14]> for GenericArray<T, U14>[src]

impl<T> AsRef<[T; 15]> for GenericArray<T, U15>[src]

impl<T> AsRef<[T; 16]> for GenericArray<T, U16>[src]

impl<T> AsRef<[T; 17]> for GenericArray<T, U17>[src]

impl<T> AsRef<[T; 18]> for GenericArray<T, U18>[src]

impl<T> AsRef<[T; 19]> for GenericArray<T, U19>[src]

impl<T> AsRef<[T; 2]> for GenericArray<T, U2>[src]

impl<T> AsRef<[T; 20]> for GenericArray<T, U20>[src]

impl<T> AsRef<[T; 21]> for GenericArray<T, U21>[src]

impl<T> AsRef<[T; 22]> for GenericArray<T, U22>[src]

impl<T> AsRef<[T; 23]> for GenericArray<T, U23>[src]

impl<T> AsRef<[T; 24]> for GenericArray<T, U24>[src]

impl<T> AsRef<[T; 25]> for GenericArray<T, U25>[src]

impl<T> AsRef<[T; 26]> for GenericArray<T, U26>[src]

impl<T> AsRef<[T; 27]> for GenericArray<T, U27>[src]

impl<T> AsRef<[T; 28]> for GenericArray<T, U28>[src]

impl<T> AsRef<[T; 29]> for GenericArray<T, U29>[src]

impl<T> AsRef<[T; 3]> for GenericArray<T, U3>[src]

impl<T> AsRef<[T; 30]> for GenericArray<T, U30>[src]

impl<T> AsRef<[T; 31]> for GenericArray<T, U31>[src]

impl<T> AsRef<[T; 32]> for GenericArray<T, U32>[src]

impl<T> AsRef<[T; 4]> for GenericArray<T, U4>[src]

impl<T> AsRef<[T; 5]> for GenericArray<T, U5>[src]

impl<T> AsRef<[T; 6]> for GenericArray<T, U6>[src]

impl<T> AsRef<[T; 7]> for GenericArray<T, U7>[src]

impl<T> AsRef<[T; 8]> for GenericArray<T, U8>[src]

impl<T> AsRef<[T; 9]> for GenericArray<T, U9>[src]

impl<T, N> AsRef<[T]> for GenericArray<T, N> where
    N: ArrayLength<T>, 
[src]

impl<T, N> Borrow<[T]> for GenericArray<T, N> where
    N: ArrayLength<T>, 
[src]

impl<T, N> BorrowMut<[T]> for GenericArray<T, N> where
    N: ArrayLength<T>, 
[src]

impl<T: Clone, N> Clone for GenericArray<T, N> where
    N: ArrayLength<T>, 
[src]

impl<T, N, M> Concat<T, M> for GenericArray<T, N> where
    N: ArrayLength<T> + Add<M>,
    M: ArrayLength<T>,
    Sum<N, M>: ArrayLength<T>, 
[src]

type Rest = GenericArray<T, M>

Sequence to be concatenated with self

type Output = GenericArray<T, Sum<N, M>>

Resulting sequence formed by the concatenation.

impl<T: Copy, N> Copy for GenericArray<T, N> where
    N: ArrayLength<T>,
    N::ArrayType: Copy
[src]

impl<T: Debug, N> Debug for GenericArray<T, N> where
    N: ArrayLength<T>, 
[src]

impl<T: Default, N> Default for GenericArray<T, N> where
    N: ArrayLength<T>, 
[src]

impl<T, N> Deref for GenericArray<T, N> where
    N: ArrayLength<T>, 
[src]

type Target = [T]

The resulting type after dereferencing.

impl<T, N> DerefMut for GenericArray<T, N> where
    N: ArrayLength<T>, 
[src]

impl<T: Eq, N> Eq for GenericArray<T, N> where
    N: ArrayLength<T>, 
[src]

impl<'a, T> From<&'a [T; 1]> for &'a GenericArray<T, U1>[src]

impl<'a, T> From<&'a [T; 10]> for &'a GenericArray<T, U10>[src]

impl<'a, T> From<&'a [T; 11]> for &'a GenericArray<T, U11>[src]

impl<'a, T> From<&'a [T; 12]> for &'a GenericArray<T, U12>[src]

impl<'a, T> From<&'a [T; 13]> for &'a GenericArray<T, U13>[src]

impl<'a, T> From<&'a [T; 14]> for &'a GenericArray<T, U14>[src]

impl<'a, T> From<&'a [T; 15]> for &'a GenericArray<T, U15>[src]

impl<'a, T> From<&'a [T; 16]> for &'a GenericArray<T, U16>[src]

impl<'a, T> From<&'a [T; 17]> for &'a GenericArray<T, U17>[src]

impl<'a, T> From<&'a [T; 18]> for &'a GenericArray<T, U18>[src]

impl<'a, T> From<&'a [T; 19]> for &'a GenericArray<T, U19>[src]

impl<'a, T> From<&'a [T; 2]> for &'a GenericArray<T, U2>[src]

impl<'a, T> From<&'a [T; 20]> for &'a GenericArray<T, U20>[src]

impl<'a, T> From<&'a [T; 21]> for &'a GenericArray<T, U21>[src]

impl<'a, T> From<&'a [T; 22]> for &'a GenericArray<T, U22>[src]

impl<'a, T> From<&'a [T; 23]> for &'a GenericArray<T, U23>[src]

impl<'a, T> From<&'a [T; 24]> for &'a GenericArray<T, U24>[src]

impl<'a, T> From<&'a [T; 25]> for &'a GenericArray<T, U25>[src]

impl<'a, T> From<&'a [T; 26]> for &'a GenericArray<T, U26>[src]

impl<'a, T> From<&'a [T; 27]> for &'a GenericArray<T, U27>[src]

impl<'a, T> From<&'a [T; 28]> for &'a GenericArray<T, U28>[src]

impl<'a, T> From<&'a [T; 29]> for &'a GenericArray<T, U29>[src]

impl<'a, T> From<&'a [T; 3]> for &'a GenericArray<T, U3>[src]

impl<'a, T> From<&'a [T; 30]> for &'a GenericArray<T, U30>[src]

impl<'a, T> From<&'a [T; 31]> for &'a GenericArray<T, U31>[src]

impl<'a, T> From<&'a [T; 32]> for &'a GenericArray<T, U32>[src]

impl<'a, T> From<&'a [T; 4]> for &'a GenericArray<T, U4>[src]

impl<'a, T> From<&'a [T; 5]> for &'a GenericArray<T, U5>[src]

impl<'a, T> From<&'a [T; 6]> for &'a GenericArray<T, U6>[src]

impl<'a, T> From<&'a [T; 7]> for &'a GenericArray<T, U7>[src]

impl<'a, T> From<&'a [T; 8]> for &'a GenericArray<T, U8>[src]

impl<'a, T> From<&'a [T; 9]> for &'a GenericArray<T, U9>[src]

impl<'a, T, N: ArrayLength<T>> From<&'a [T]> for &'a GenericArray<T, N>[src]

fn from(slice: &[T]) -> &GenericArray<T, N>[src]

Converts slice to a generic array reference with inferred length;

Length of the slice must be equal to the length of the array.

impl<'a, T> From<&'a mut [T; 1]> for &'a mut GenericArray<T, U1>[src]

impl<'a, T> From<&'a mut [T; 10]> for &'a mut GenericArray<T, U10>[src]

impl<'a, T> From<&'a mut [T; 11]> for &'a mut GenericArray<T, U11>[src]

impl<'a, T> From<&'a mut [T; 12]> for &'a mut GenericArray<T, U12>[src]

impl<'a, T> From<&'a mut [T; 13]> for &'a mut GenericArray<T, U13>[src]

impl<'a, T> From<&'a mut [T; 14]> for &'a mut GenericArray<T, U14>[src]

impl<'a, T> From<&'a mut [T; 15]> for &'a mut GenericArray<T, U15>[src]

impl<'a, T> From<&'a mut [T; 16]> for &'a mut GenericArray<T, U16>[src]

impl<'a, T> From<&'a mut [T; 17]> for &'a mut GenericArray<T, U17>[src]

impl<'a, T> From<&'a mut [T; 18]> for &'a mut GenericArray<T, U18>[src]

impl<'a, T> From<&'a mut [T; 19]> for &'a mut GenericArray<T, U19>[src]

impl<'a, T> From<&'a mut [T; 2]> for &'a mut GenericArray<T, U2>[src]

impl<'a, T> From<&'a mut [T; 20]> for &'a mut GenericArray<T, U20>[src]

impl<'a, T> From<&'a mut [T; 21]> for &'a mut GenericArray<T, U21>[src]

impl<'a, T> From<&'a mut [T; 22]> for &'a mut GenericArray<T, U22>[src]

impl<'a, T> From<&'a mut [T; 23]> for &'a mut GenericArray<T, U23>[src]

impl<'a, T> From<&'a mut [T; 24]> for &'a mut GenericArray<T, U24>[src]

impl<'a, T> From<&'a mut [T; 25]> for &'a mut GenericArray<T, U25>[src]

impl<'a, T> From<&'a mut [T; 26]> for &'a mut GenericArray<T, U26>[src]

impl<'a, T> From<&'a mut [T; 27]> for &'a mut GenericArray<T, U27>[src]

impl<'a, T> From<&'a mut [T; 28]> for &'a mut GenericArray<T, U28>[src]

impl<'a, T> From<&'a mut [T; 29]> for &'a mut GenericArray<T, U29>[src]

impl<'a, T> From<&'a mut [T; 3]> for &'a mut GenericArray<T, U3>[src]

impl<'a, T> From<&'a mut [T; 30]> for &'a mut GenericArray<T, U30>[src]

impl<'a, T> From<&'a mut [T; 31]> for &'a mut GenericArray<T, U31>[src]

impl<'a, T> From<&'a mut [T; 32]> for &'a mut GenericArray<T, U32>[src]

impl<'a, T> From<&'a mut [T; 4]> for &'a mut GenericArray<T, U4>[src]

impl<'a, T> From<&'a mut [T; 5]> for &'a mut GenericArray<T, U5>[src]

impl<'a, T> From<&'a mut [T; 6]> for &'a mut GenericArray<T, U6>[src]

impl<'a, T> From<&'a mut [T; 7]> for &'a mut GenericArray<T, U7>[src]

impl<'a, T> From<&'a mut [T; 8]> for &'a mut GenericArray<T, U8>[src]

impl<'a, T> From<&'a mut [T; 9]> for &'a mut GenericArray<T, U9>[src]

impl<'a, T, N: ArrayLength<T>> From<&'a mut [T]> for &'a mut GenericArray<T, N>[src]

fn from(slice: &mut [T]) -> &mut GenericArray<T, N>[src]

Converts mutable slice to a mutable generic array reference

Length of the slice must be equal to the length of the array.

impl<T> From<[T; 1]> for GenericArray<T, U1>[src]

impl<T> From<[T; 10]> for GenericArray<T, U10>[src]

impl<T> From<[T; 11]> for GenericArray<T, U11>[src]

impl<T> From<[T; 12]> for GenericArray<T, U12>[src]

impl<T> From<[T; 13]> for GenericArray<T, U13>[src]

impl<T> From<[T; 14]> for GenericArray<T, U14>[src]

impl<T> From<[T; 15]> for GenericArray<T, U15>[src]

impl<T> From<[T; 16]> for GenericArray<T, U16>[src]

impl<T> From<[T; 17]> for GenericArray<T, U17>[src]

impl<T> From<[T; 18]> for GenericArray<T, U18>[src]

impl<T> From<[T; 19]> for GenericArray<T, U19>[src]

impl<T> From<[T; 2]> for GenericArray<T, U2>[src]

impl<T> From<[T; 20]> for GenericArray<T, U20>[src]

impl<T> From<[T; 21]> for GenericArray<T, U21>[src]

impl<T> From<[T; 22]> for GenericArray<T, U22>[src]

impl<T> From<[T; 23]> for GenericArray<T, U23>[src]

impl<T> From<[T; 24]> for GenericArray<T, U24>[src]

impl<T> From<[T; 25]> for GenericArray<T, U25>[src]

impl<T> From<[T; 26]> for GenericArray<T, U26>[src]

impl<T> From<[T; 27]> for GenericArray<T, U27>[src]

impl<T> From<[T; 28]> for GenericArray<T, U28>[src]

impl<T> From<[T; 29]> for GenericArray<T, U29>[src]

impl<T> From<[T; 3]> for GenericArray<T, U3>[src]

impl<T> From<[T; 30]> for GenericArray<T, U30>[src]

impl<T> From<[T; 31]> for GenericArray<T, U31>[src]

impl<T> From<[T; 32]> for GenericArray<T, U32>[src]

impl<T> From<[T; 4]> for GenericArray<T, U4>[src]

impl<T> From<[T; 5]> for GenericArray<T, U5>[src]

impl<T> From<[T; 6]> for GenericArray<T, U6>[src]

impl<T> From<[T; 7]> for GenericArray<T, U7>[src]

impl<T> From<[T; 8]> for GenericArray<T, U8>[src]

impl<T> From<[T; 9]> for GenericArray<T, U9>[src]

impl<T, N> FromIterator<T> for GenericArray<T, N> where
    N: ArrayLength<T>, 
[src]

impl<T, N> FunctionalSequence<T> for GenericArray<T, N> where
    N: ArrayLength<T>,
    Self: GenericSequence<T, Item = T, Length = N>, 
[src]

impl<T, N> GenericSequence<T> for GenericArray<T, N> where
    N: ArrayLength<T>,
    Self: IntoIterator<Item = T>, 
[src]

type Length = N

GenericArray associated length

type Sequence = Self

Concrete sequence type used in conjuction with reference implementations of GenericSequence

impl<T: Hash, N> Hash for GenericArray<T, N> where
    N: ArrayLength<T>, 
[src]

impl<T, N> IntoIterator for GenericArray<T, N> where
    N: ArrayLength<T>, 
[src]

type Item = T

The type of the elements being iterated over.

type IntoIter = GenericArrayIter<T, N>

Which kind of iterator are we turning this into?

impl<'a, T: 'a, N> IntoIterator for &'a GenericArray<T, N> where
    N: ArrayLength<T>, 
[src]

type IntoIter = Iter<'a, T>

Which kind of iterator are we turning this into?

type Item = &'a T

The type of the elements being iterated over.

impl<'a, T: 'a, N> IntoIterator for &'a mut GenericArray<T, N> where
    N: ArrayLength<T>, 
[src]

type IntoIter = IterMut<'a, T>

Which kind of iterator are we turning this into?

type Item = &'a mut T

The type of the elements being iterated over.

impl<T, N: ArrayLength<T>> Lengthen<T> for GenericArray<T, N> where
    N: Add<B1>,
    Add1<N>: ArrayLength<T>,
    Add1<N>: Sub<B1, Output = N>,
    Sub1<Add1<N>>: ArrayLength<T>, 
[src]

type Longer = GenericArray<T, Add1<N>>

GenericSequence that has one more element than Self

impl<T: ArrayLength<u8>> LowerHex for GenericArray<u8, T> where
    T: Add<T>,
    <T as Add<T>>::Output: ArrayLength<u8>, 
[src]

impl<T, U, N> MappedGenericSequence<T, U> for GenericArray<T, N> where
    N: ArrayLength<T> + ArrayLength<U>,
    GenericArray<U, N>: GenericSequence<U, Length = N>, 
[src]

type Mapped = GenericArray<U, N>

Mapped sequence type

impl<T: Ord, N> Ord for GenericArray<T, N> where
    N: ArrayLength<T>, 
[src]

impl<T: PartialEq, N> PartialEq<GenericArray<T, N>> for GenericArray<T, N> where
    N: ArrayLength<T>, 
[src]

impl<T: PartialOrd, N> PartialOrd<GenericArray<T, N>> for GenericArray<T, N> where
    N: ArrayLength<T>, 
[src]

impl<T: Send, N: ArrayLength<T>> Send for GenericArray<T, N>[src]

impl<T, N: ArrayLength<T>> Shorten<T> for GenericArray<T, N> where
    N: Sub<B1>,
    Sub1<N>: ArrayLength<T>,
    Sub1<N>: Add<B1, Output = N>,
    Add1<Sub1<N>>: ArrayLength<T>, 
[src]

type Shorter = GenericArray<T, Sub1<N>>

GenericSequence that has one less element than Self

impl<T, N, K> Split<T, K> for GenericArray<T, N> where
    N: ArrayLength<T>,
    K: ArrayLength<T>,
    N: Sub<K>,
    Diff<N, K>: ArrayLength<T>, 
[src]

type First = GenericArray<T, K>

First part of the resulting split array

type Second = GenericArray<T, Diff<N, K>>

Second part of the resulting split array

impl<'a, T, N, K> Split<T, K> for &'a GenericArray<T, N> where
    N: ArrayLength<T>,
    K: ArrayLength<T> + 'static,
    N: Sub<K>,
    Diff<N, K>: ArrayLength<T>, 
[src]

type First = &'a GenericArray<T, K>

First part of the resulting split array

type Second = &'a GenericArray<T, Diff<N, K>>

Second part of the resulting split array

impl<'a, T, N, K> Split<T, K> for &'a mut GenericArray<T, N> where
    N: ArrayLength<T>,
    K: ArrayLength<T> + 'static,
    N: Sub<K>,
    Diff<N, K>: ArrayLength<T>, 
[src]

type First = &'a mut GenericArray<T, K>

First part of the resulting split array

type Second = &'a mut GenericArray<T, Diff<N, K>>

Second part of the resulting split array

impl<T: Sync, N: ArrayLength<T>> Sync for GenericArray<T, N>[src]

impl<T: ArrayLength<u8>> UpperHex for GenericArray<u8, T> where
    T: Add<T>,
    <T as Add<T>>::Output: ArrayLength<u8>, 
[src]

Auto Trait Implementations

impl<T, U> Unpin for GenericArray<T, U> where
    <U as ArrayLength<T>>::ArrayType: Unpin

Blanket Implementations

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

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

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

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

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

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

type Output = T

Should always be Self

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.