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]
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>
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
impl<T: Clone, N> GenericArray<T, N> where N: ArrayLength<T>
[src]
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
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
Trait Implementations
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?
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::Output: ArrayLength<u8>
[src]
T::Output: ArrayLength<u8>
impl<T: ArrayLength<u8>> UpperHex for GenericArray<u8, T> where T: Add<T>,
T::Output: ArrayLength<u8>
[src]
T::Output: ArrayLength<u8>
impl<T, N> Deref for GenericArray<T, N> where N: ArrayLength<T>
[src]
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]
fn deref_mut(&mut self) -> &mut [T]
The method called to mutably dereference a value
impl<T: Default, N> Default for GenericArray<T, N> where N: ArrayLength<T>
[src]
impl<T: Clone, N> Clone for GenericArray<T, N> where N: ArrayLength<T>
[src]
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::ArrayType: Copy
impl<T: PartialEq, N> PartialEq for GenericArray<T, N> where N: ArrayLength<T>
[src]
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]
impl<T: PartialOrd, N> PartialOrd for GenericArray<T, N> where N: ArrayLength<T>
[src]
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]
fn cmp(&self, other: &GenericArray<T, N>) -> Ordering
This method returns an Ordering
between self
and other
. Read more