Struct generic_array::GenericArray
source · [−]#[repr(transparent)]pub struct GenericArray<T, U: ArrayLength<T>> { /* private fields */ }
Expand description
Struct representing a generic array - GenericArray<T, N>
works like [T; N]
Implementations
sourceimpl<T, N> GenericArray<T, N> where
N: ArrayLength<T>,
impl<T, N> GenericArray<T, N> where
N: ArrayLength<T>,
sourcepub fn as_mut_slice(&mut self) -> &mut [T]
pub fn as_mut_slice(&mut self) -> &mut [T]
Extracts a mutable slice containing the entire array.
sourcepub fn from_slice(slice: &[T]) -> &GenericArray<T, N>
pub fn from_slice(slice: &[T]) -> &GenericArray<T, N>
Converts slice to a generic array reference with inferred length;
Length of the slice must be equal to the length of the array.
sourcepub fn from_mut_slice(slice: &mut [T]) -> &mut GenericArray<T, N>
pub fn from_mut_slice(slice: &mut [T]) -> &mut GenericArray<T, N>
Converts mutable slice to a mutable generic array reference
Length of the slice must be equal to the length of the array.
sourceimpl<T: Clone, N> GenericArray<T, N> where
N: ArrayLength<T>,
impl<T: Clone, N> GenericArray<T, N> where
N: ArrayLength<T>,
sourcepub fn clone_from_slice(list: &[T]) -> GenericArray<T, N>
pub fn clone_from_slice(list: &[T]) -> GenericArray<T, N>
Construct a GenericArray
from a slice by cloning its content
Length of the slice must be equal to the length of the array
sourceimpl<T, N> GenericArray<T, N> where
N: ArrayLength<T>,
impl<T, N> GenericArray<T, N> where
N: ArrayLength<T>,
sourcepub fn from_exact_iter<I>(iter: I) -> Option<Self> where
I: IntoIterator<Item = T>,
pub fn from_exact_iter<I>(iter: I) -> Option<Self> where
I: IntoIterator<Item = T>,
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
sourceimpl<T, N> AsMut<[T]> for GenericArray<T, N> where
N: ArrayLength<T>,
impl<T, N> AsMut<[T]> for GenericArray<T, N> where
N: ArrayLength<T>,
sourceimpl<T, N> AsRef<[T]> for GenericArray<T, N> where
N: ArrayLength<T>,
impl<T, N> AsRef<[T]> for GenericArray<T, N> where
N: ArrayLength<T>,
sourceimpl<T, N> Borrow<[T]> for GenericArray<T, N> where
N: ArrayLength<T>,
impl<T, N> Borrow<[T]> for GenericArray<T, N> where
N: ArrayLength<T>,
sourceimpl<T, N> BorrowMut<[T]> for GenericArray<T, N> where
N: ArrayLength<T>,
impl<T, N> BorrowMut<[T]> for GenericArray<T, N> where
N: ArrayLength<T>,
sourcefn borrow_mut(&mut self) -> &mut [T]
fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more
sourceimpl<T: Clone, N> Clone for GenericArray<T, N> where
N: ArrayLength<T>,
impl<T: Clone, N> Clone for GenericArray<T, N> where
N: ArrayLength<T>,
sourcefn clone(&self) -> GenericArray<T, N>
fn clone(&self) -> GenericArray<T, N>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<T, N, M> Concat<T, M> for GenericArray<T, N> where
N: ArrayLength<T> + Add<M>,
M: ArrayLength<T>,
Sum<N, M>: ArrayLength<T>,
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>,
type Rest = GenericArray<T, M>
type Rest = GenericArray<T, M>
Sequence to be concatenated with self
type Output = GenericArray<T, Sum<N, M>>
type Output = GenericArray<T, Sum<N, M>>
Resulting sequence formed by the concatenation.
sourceimpl<T: Debug, N> Debug for GenericArray<T, N> where
N: ArrayLength<T>,
impl<T: Debug, N> Debug for GenericArray<T, N> where
N: ArrayLength<T>,
sourceimpl<T: Default, N> Default for GenericArray<T, N> where
N: ArrayLength<T>,
impl<T: Default, N> Default for GenericArray<T, N> where
N: ArrayLength<T>,
sourceimpl<T, N> Deref for GenericArray<T, N> where
N: ArrayLength<T>,
impl<T, N> Deref for GenericArray<T, N> where
N: ArrayLength<T>,
sourceimpl<T, N> DerefMut for GenericArray<T, N> where
N: ArrayLength<T>,
impl<T, N> DerefMut for GenericArray<T, N> where
N: ArrayLength<T>,
sourceimpl<'a, T, N: ArrayLength<T>> From<&'a [T]> for &'a GenericArray<T, N>
impl<'a, T, N: ArrayLength<T>> From<&'a [T]> for &'a GenericArray<T, N>
sourcefn from(slice: &[T]) -> &GenericArray<T, N>
fn from(slice: &[T]) -> &GenericArray<T, N>
Converts slice to a generic array reference with inferred length;
Length of the slice must be equal to the length of the array.
sourceimpl<'a, T, N: ArrayLength<T>> From<&'a mut [T]> for &'a mut GenericArray<T, N>
impl<'a, T, N: ArrayLength<T>> From<&'a mut [T]> for &'a mut GenericArray<T, N>
sourcefn from(slice: &mut [T]) -> &mut GenericArray<T, N>
fn from(slice: &mut [T]) -> &mut GenericArray<T, N>
Converts mutable slice to a mutable generic array reference
Length of the slice must be equal to the length of the array.
sourceimpl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]
sourceimpl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>>> for [T; 16]
impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>>> for [T; 16]
sourceimpl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B1>>> for [T; 17]
impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B1>>> for [T; 17]
sourceimpl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>, B0>>> for [T; 18]
impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>, B0>>> for [T; 18]
sourceimpl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>, B1>>> for [T; 19]
impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B1>, B1>>> for [T; 19]
sourceimpl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>, B0>>> for [T; 20]
impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>, B0>>> for [T; 20]
sourceimpl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>, B1>>> for [T; 21]
impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>, B1>>> for [T; 21]
sourceimpl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B1>, B0>>> for [T; 22]
impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B1>, B0>>> for [T; 22]
sourceimpl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B1>, B1>>> for [T; 23]
impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B1>, B1>>> for [T; 23]
sourceimpl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>>> for [T; 24]
impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>>> for [T; 24]
sourceimpl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B1>>> for [T; 25]
impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B1>>> for [T; 25]
sourceimpl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B1>, B0>>> for [T; 26]
impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B1>, B0>>> for [T; 26]
sourceimpl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B1>, B1>>> for [T; 27]
impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B1>, B1>>> for [T; 27]
sourceimpl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, B0>>> for [T; 28]
impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, B0>>> for [T; 28]
sourceimpl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, B1>>> for [T; 29]
impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B0>, B1>>> for [T; 29]
sourceimpl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B0>>> for [T; 30]
impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B0>>> for [T; 30]
sourceimpl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B1>>> for [T; 31]
impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B1>, B1>, B1>>> for [T; 31]
sourceimpl<T, N> FromIterator<T> for GenericArray<T, N> where
N: ArrayLength<T>,
impl<T, N> FromIterator<T> for GenericArray<T, N> where
N: ArrayLength<T>,
sourcefn from_iter<I>(iter: I) -> GenericArray<T, N> where
I: IntoIterator<Item = T>,
fn from_iter<I>(iter: I) -> GenericArray<T, N> where
I: IntoIterator<Item = T>,
Creates a value from an iterator. Read more
sourceimpl<T, N> FunctionalSequence<T> for GenericArray<T, N> where
N: ArrayLength<T>,
Self: GenericSequence<T, Item = T, Length = N>,
impl<T, N> FunctionalSequence<T> for GenericArray<T, N> where
N: ArrayLength<T>,
Self: GenericSequence<T, Item = T, Length = N>,
sourcefn map<U, F>(self, f: F) -> MappedSequence<Self, T, U> where
Self::Length: ArrayLength<U>,
Self: MappedGenericSequence<T, U>,
F: FnMut(T) -> U,
fn map<U, F>(self, f: F) -> MappedSequence<Self, T, U> where
Self::Length: ArrayLength<U>,
Self: MappedGenericSequence<T, U>,
F: FnMut(T) -> U,
Maps a GenericSequence
to another GenericSequence
. Read more
sourcefn zip<B, Rhs, U, F>(self, rhs: Rhs, f: F) -> MappedSequence<Self, T, U> where
Self: MappedGenericSequence<T, U>,
Rhs: MappedGenericSequence<B, U, Mapped = MappedSequence<Self, T, U>>,
Self::Length: ArrayLength<B> + ArrayLength<U>,
Rhs: GenericSequence<B, Length = Self::Length>,
F: FnMut(T, Rhs::Item) -> U,
fn zip<B, Rhs, U, F>(self, rhs: Rhs, f: F) -> MappedSequence<Self, T, U> where
Self: MappedGenericSequence<T, U>,
Rhs: MappedGenericSequence<B, U, Mapped = MappedSequence<Self, T, U>>,
Self::Length: ArrayLength<B> + ArrayLength<U>,
Rhs: GenericSequence<B, Length = Self::Length>,
F: FnMut(T, Rhs::Item) -> U,
Combines two GenericSequence
instances and iterates through both of them,
initializing a new GenericSequence
with the result of the zipped mapping function. Read more
sourceimpl<T, N> GenericSequence<T> for GenericArray<T, N> where
N: ArrayLength<T>,
Self: IntoIterator<Item = T>,
impl<T, N> GenericSequence<T> for GenericArray<T, N> where
N: ArrayLength<T>,
Self: IntoIterator<Item = T>,
sourceimpl<T: Hash, N> Hash for GenericArray<T, N> where
N: ArrayLength<T>,
impl<T: Hash, N> Hash for GenericArray<T, N> where
N: ArrayLength<T>,
sourceimpl<T, N> IntoIterator for GenericArray<T, N> where
N: ArrayLength<T>,
impl<T, N> IntoIterator for GenericArray<T, N> where
N: ArrayLength<T>,
sourceimpl<'a, T: 'a, N> IntoIterator for &'a GenericArray<T, N> where
N: ArrayLength<T>,
impl<'a, T: 'a, N> IntoIterator for &'a GenericArray<T, N> where
N: ArrayLength<T>,
sourceimpl<'a, T: 'a, N> IntoIterator for &'a mut GenericArray<T, N> where
N: ArrayLength<T>,
impl<'a, T: 'a, N> IntoIterator for &'a mut GenericArray<T, N> where
N: ArrayLength<T>,
sourceimpl<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>,
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>,
sourceimpl<T: ArrayLength<u8>> LowerHex for GenericArray<u8, T> where
T: Add<T>,
<T as Add<T>>::Output: ArrayLength<u8>,
impl<T: ArrayLength<u8>> LowerHex for GenericArray<u8, T> where
T: Add<T>,
<T as Add<T>>::Output: ArrayLength<u8>,
sourceimpl<T, U, N> MappedGenericSequence<T, U> for GenericArray<T, N> where
N: ArrayLength<T> + ArrayLength<U>,
GenericArray<U, N>: GenericSequence<U, Length = N>,
impl<T, U, N> MappedGenericSequence<T, U> for GenericArray<T, N> where
N: ArrayLength<T> + ArrayLength<U>,
GenericArray<U, N>: GenericSequence<U, Length = N>,
type Mapped = GenericArray<U, N>
type Mapped = GenericArray<U, N>
Mapped sequence type
sourceimpl<T: Ord, N> Ord for GenericArray<T, N> where
N: ArrayLength<T>,
impl<T: Ord, N> Ord for GenericArray<T, N> where
N: ArrayLength<T>,
sourceimpl<T: PartialEq, N> PartialEq<GenericArray<T, N>> for GenericArray<T, N> where
N: ArrayLength<T>,
impl<T: PartialEq, N> PartialEq<GenericArray<T, N>> for GenericArray<T, N> where
N: ArrayLength<T>,
sourceimpl<T: PartialOrd, N> PartialOrd<GenericArray<T, N>> for GenericArray<T, N> where
N: ArrayLength<T>,
impl<T: PartialOrd, N> PartialOrd<GenericArray<T, N>> for GenericArray<T, N> where
N: ArrayLength<T>,
sourcefn partial_cmp(&self, other: &GenericArray<T, N>) -> Option<Ordering>
fn partial_cmp(&self, other: &GenericArray<T, N>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<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>,
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>,
sourceimpl<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>,
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>,
sourceimpl<'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>,
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>,
sourceimpl<'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>,
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>,
sourceimpl<T: ArrayLength<u8>> UpperHex for GenericArray<u8, T> where
T: Add<T>,
<T as Add<T>>::Output: ArrayLength<u8>,
impl<T: ArrayLength<u8>> UpperHex for GenericArray<u8, T> where
T: Add<T>,
<T as Add<T>>::Output: ArrayLength<u8>,
impl<T: Copy, N> Copy for GenericArray<T, N> where
N: ArrayLength<T>,
N::ArrayType: Copy,
impl<T: Eq, N> Eq for GenericArray<T, N> where
N: ArrayLength<T>,
impl<T: Send, N: ArrayLength<T>> Send for GenericArray<T, N>
impl<T: Sync, N: ArrayLength<T>> Sync for GenericArray<T, N>
Auto Trait Implementations
impl<T, U> RefUnwindSafe for GenericArray<T, U> where
<U as ArrayLength<T>>::ArrayType: RefUnwindSafe,
impl<T, U> Unpin for GenericArray<T, U> where
<U as ArrayLength<T>>::ArrayType: Unpin,
impl<T, U> UnwindSafe for GenericArray<T, U> where
<U as ArrayLength<T>>::ArrayType: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more