Struct generic_array::GenericArray
[−]
[src]
pub struct GenericArray<T, U: ArrayLength<T>> { /* fields omitted */ }
Struct representing a generic array - GenericArray<T, N>
works like [T; N]
Methods
impl<T, N> GenericArray<T, N> where
N: ArrayLength<T>,
[src]
N: ArrayLength<T>,
fn map_slice<S, F: Fn(&S) -> T>(s: &[S], f: F) -> GenericArray<T, N>
map a function over a slice to a GenericArray
.
The length of the slice must be equal to the length of the array
fn map<U, F>(self, f: F) -> GenericArray<U, N> where
F: Fn(&T) -> U,
N: ArrayLength<U>,
F: Fn(&T) -> U,
N: ArrayLength<U>,
map a function over a GenericArray
.
fn as_slice(&self) -> &[T]
Extracts a slice containing the entire array
fn as_mut_slice(&mut self) -> &mut [T]
Extracts a mutable slice containing the entire array
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
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
impl<T: Clone, N> GenericArray<T, N> where
N: ArrayLength<T>,
[src]
N: ArrayLength<T>,
fn clone_from_slice(list: &[T]) -> GenericArray<T, N>
Function constructing an array from a slice by clonning its content
Length of the slice must be equal to the length of the array
Trait Implementations
impl<T, N> IntoIterator for GenericArray<T, N> where
N: ArrayLength<T>,
[src]
N: ArrayLength<T>,
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?
fn into_iter(self) -> Self::IntoIter
Creates an iterator from a value. Read more
impl<T: ArrayLength<u8>> LowerHex for GenericArray<u8, T> where
T: Add<T>,
<T as Add<T>>::Output: ArrayLength<u8>,
[src]
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>,
[src]
T: Add<T>,
<T as Add<T>>::Output: ArrayLength<u8>,
impl<T: Default, N> Default for GenericArray<T, N> where
N: ArrayLength<T>,
[src]
N: ArrayLength<T>,
impl<T: Clone, N> Clone for GenericArray<T, N> where
N: ArrayLength<T>,
[src]
N: ArrayLength<T>,
fn clone(&self) -> GenericArray<T, N>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<T: Copy, N> Copy for GenericArray<T, N> where
N: ArrayLength<T>,
N::ArrayType: Copy,
[src]
N: ArrayLength<T>,
N::ArrayType: Copy,
impl<T: PartialEq, N> PartialEq for GenericArray<T, N> where
N: ArrayLength<T>,
[src]
N: ArrayLength<T>,
fn eq(&self, other: &Self) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.
impl<T: Eq, N> Eq for GenericArray<T, N> where
N: ArrayLength<T>,
[src]
N: ArrayLength<T>,
impl<T: PartialOrd, N> PartialOrd for GenericArray<T, N> where
N: ArrayLength<T>,
[src]
N: ArrayLength<T>,
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
fn lt(&self, other: &Rhs) -> bool
1.0.0
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<T: Ord, N> Ord for GenericArray<T, N> where
N: ArrayLength<T>,
[src]
N: ArrayLength<T>,
fn cmp(&self, other: &GenericArray<T, N>) -> Ordering
This method returns an Ordering
between self
and other
. Read more
impl<T: Debug, N> Debug for GenericArray<T, N> where
N: ArrayLength<T>,
[src]
N: ArrayLength<T>,
impl<T, N> Borrow<[T]> for GenericArray<T, N> where
N: ArrayLength<T>,
[src]
N: ArrayLength<T>,
impl<T, N> BorrowMut<[T]> for GenericArray<T, N> where
N: ArrayLength<T>,
[src]
N: ArrayLength<T>,
fn borrow_mut(&mut self) -> &mut [T]
Mutably borrows from an owned value. Read more
impl<T, N> AsRef<[T]> for GenericArray<T, N> where
N: ArrayLength<T>,
[src]
N: ArrayLength<T>,
fn as_ref(&self) -> &[T]
Performs the conversion.
impl<T, N> AsMut<[T]> for GenericArray<T, N> where
N: ArrayLength<T>,
[src]
N: ArrayLength<T>,
fn as_mut(&mut self) -> &mut [T]
Performs the conversion.
impl<T: Hash, N> Hash for GenericArray<T, N> where
N: ArrayLength<T>,
[src]
N: ArrayLength<T>,
fn hash<H>(&self, state: &mut H) where
H: Hasher,
H: Hasher,
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<T, N> Deref for GenericArray<T, N> where
N: ArrayLength<T>,
[src]
N: ArrayLength<T>,
type Target = [T]
The resulting type after dereferencing
fn deref(&self) -> &[T]
The method called to dereference a value
impl<T, N> DerefMut for GenericArray<T, N> where
N: ArrayLength<T>,
[src]
N: ArrayLength<T>,
fn deref_mut(&mut self) -> &mut [T]
The method called to mutably dereference a value