[−][src]Struct generic_array::GenericArray
Struct representing a generic array - GenericArray<T, N> works like [T; N]
Methods
impl<T, N> GenericArray<T, N> where
N: ArrayLength<T>, [src]
impl<T, N> GenericArray<T, N> where
N: ArrayLength<T>, pub fn generate<F>(f: F) -> GenericArray<T, N> where
F: Fn(usize) -> T, [src]
pub fn generate<F>(f: F) -> GenericArray<T, N> where
F: Fn(usize) -> T, Initializes a new GenericArray instance using the given function.
If the generator function panics while initializing the array, any already initialized elements will be dropped.
pub fn map_slice<S, F: Fn(&S) -> T>(s: &[S], f: F) -> GenericArray<T, N>[src]
pub 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.
pub fn map<U, F>(self, f: F) -> GenericArray<U, N> where
F: Fn(T) -> U,
N: ArrayLength<U>, [src]
pub fn map<U, F>(self, f: F) -> GenericArray<U, N> where
F: Fn(T) -> U,
N: ArrayLength<U>, Maps a GenericArray to another GenericArray.
If the mapping function panics, any already initialized elements in the new array will be dropped, AND any unused elements in the source array will also be dropped.
pub fn map_ref<U, F>(&self, f: F) -> GenericArray<U, N> where
F: Fn(&T) -> U,
N: ArrayLength<U>, [src]
pub fn map_ref<U, F>(&self, f: F) -> GenericArray<U, N> where
F: Fn(&T) -> U,
N: ArrayLength<U>, Maps a GenericArray to another GenericArray by reference.
If the mapping function panics, any already initialized elements will be dropped.
pub fn zip<B, U, F>(self, rhs: GenericArray<B, N>, f: F) -> GenericArray<U, N> where
F: Fn(T, B) -> U,
N: ArrayLength<B> + ArrayLength<U>, [src]
pub fn zip<B, U, F>(self, rhs: GenericArray<B, N>, f: F) -> GenericArray<U, N> where
F: Fn(T, B) -> U,
N: ArrayLength<B> + ArrayLength<U>, Combines two GenericArray instances and iterates through both of them,
initializing a new GenericArray with the result of the zipped mapping function.
If the mapping function panics, any already initialized elements in the new array will be dropped, AND any unused elements in the source arrays will also be dropped.
pub fn zip_ref<B, U, F>(
&self,
rhs: &GenericArray<B, N>,
f: F
) -> GenericArray<U, N> where
F: Fn(&T, &B) -> U,
N: ArrayLength<B> + ArrayLength<U>, [src]
pub fn zip_ref<B, U, F>(
&self,
rhs: &GenericArray<B, N>,
f: F
) -> GenericArray<U, N> where
F: Fn(&T, &B) -> U,
N: ArrayLength<B> + ArrayLength<U>, Combines two GenericArray instances and iterates through both of them by reference,
initializing a new GenericArray with the result of the zipped mapping function.
If the mapping function panics, any already initialized elements will be dropped.
pub fn as_slice(&self) -> &[T][src]
pub fn as_slice(&self) -> &[T]Extracts a slice containing the entire array.
pub fn as_mut_slice(&mut self) -> &mut [T][src]
pub fn as_mut_slice(&mut self) -> &mut [T]Extracts a mutable slice containing the entire array.
pub fn from_slice(slice: &[T]) -> &GenericArray<T, N>[src]
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.
pub fn from_mut_slice(slice: &mut [T]) -> &mut GenericArray<T, N>[src]
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.
impl<T: Clone, N> GenericArray<T, N> where
N: ArrayLength<T>, [src]
impl<T: Clone, N> GenericArray<T, N> where
N: ArrayLength<T>, pub fn clone_from_slice(list: &[T]) -> GenericArray<T, N>[src]
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
impl<T, N> GenericArray<T, N> where
N: ArrayLength<T>, [src]
impl<T, N> GenericArray<T, N> where
N: ArrayLength<T>, pub fn from_exact_iter<I>(iter: I) -> Option<Self> where
I: IntoIterator<Item = T>,
<I as IntoIterator>::IntoIter: ExactSizeIterator, [src]
pub fn from_exact_iter<I>(iter: I) -> Option<Self> where
I: IntoIterator<Item = T>,
<I as IntoIterator>::IntoIter: ExactSizeIterator, Trait Implementations
impl<T: PartialEq, N> PartialEq<GenericArray<T, N>> 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>, fn eq(&self, other: &Self) -> bool[src]
fn eq(&self, other: &Self) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl<T: Eq, N> Eq for GenericArray<T, N> where
N: ArrayLength<T>, [src]
impl<T: Eq, N> Eq for GenericArray<T, N> where
N: ArrayLength<T>, impl<T: Ord, N> Ord for GenericArray<T, N> where
N: ArrayLength<T>, [src]
impl<T: Ord, N> Ord for GenericArray<T, N> where
N: ArrayLength<T>, fn cmp(&self, other: &GenericArray<T, N>) -> Ordering[src]
fn cmp(&self, other: &GenericArray<T, N>) -> OrderingThis method returns an Ordering between self and other. Read more
fn max(self, other: Self) -> Self1.21.0[src]
fn max(self, other: Self) -> SelfCompares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self1.21.0[src]
fn min(self, other: Self) -> SelfCompares and returns the minimum of two values. Read more
impl<T: PartialOrd, N> PartialOrd<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>, fn partial_cmp(&self, other: &GenericArray<T, N>) -> Option<Ordering>[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
#[must_use]
fn lt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn lt(&self, other: &Rhs) -> boolThis method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]
fn le(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn le(&self, other: &Rhs) -> boolThis method tests less than or equal to (for self and other) and is used by the <= operator. Read more
#[must_use]
fn gt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn gt(&self, other: &Rhs) -> boolThis method tests greater than (for self and other) and is used by the > operator. Read more
#[must_use]
fn ge(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ge(&self, other: &Rhs) -> boolThis method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
impl<T: Debug, N> Debug for GenericArray<T, N> where
N: ArrayLength<T>, [src]
impl<T: Debug, N> Debug for GenericArray<T, N> where
N: ArrayLength<T>, fn fmt(&self, fmt: &mut Formatter) -> Result[src]
fn fmt(&self, fmt: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl<T, N> Deref for GenericArray<T, N> where
N: ArrayLength<T>, [src]
impl<T, N> Deref for GenericArray<T, N> where
N: ArrayLength<T>, type Target = [T]
The resulting type after dereferencing.
fn deref(&self) -> &[T][src]
fn deref(&self) -> &[T]Dereferences the value.
impl<T, N> DerefMut for GenericArray<T, N> where
N: ArrayLength<T>, [src]
impl<T, N> DerefMut for GenericArray<T, N> where
N: ArrayLength<T>, impl<T: Hash, N> Hash for GenericArray<T, N> where
N: ArrayLength<T>, [src]
impl<T: Hash, N> Hash for GenericArray<T, N> where
N: ArrayLength<T>, fn hash<H>(&self, state: &mut H) where
H: Hasher, [src]
fn hash<H>(&self, state: &mut H) where
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[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, Feeds a slice of this type into the given [Hasher]. Read more
impl<T, N> FromIterator<T> for GenericArray<T, N> where
N: ArrayLength<T>,
T: Default, [src]
impl<T, N> FromIterator<T> for GenericArray<T, N> where
N: ArrayLength<T>,
T: Default, fn from_iter<I>(iter: I) -> GenericArray<T, N> where
I: IntoIterator<Item = T>, [src]
fn from_iter<I>(iter: I) -> GenericArray<T, N> where
I: IntoIterator<Item = T>, Creates a value from an iterator. Read more
impl<T: Copy, N> Copy for GenericArray<T, N> where
N: ArrayLength<T>,
N::ArrayType: Copy, [src]
impl<T: Copy, N> Copy for GenericArray<T, N> where
N: ArrayLength<T>,
N::ArrayType: Copy, impl<T, N> IntoIterator for GenericArray<T, N> where
N: ArrayLength<T>, [src]
impl<T, N> IntoIterator for GenericArray<T, N> where
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[src]
fn into_iter(self) -> Self::IntoIterCreates 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]
impl<T: ArrayLength<u8>> LowerHex 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>, [src]
impl<T: ArrayLength<u8>> UpperHex for GenericArray<u8, T> where
T: Add<T>,
<T as Add<T>>::Output: ArrayLength<u8>, impl<T> From<[T; 1]> for GenericArray<T, U1>[src]
impl<T> From<[T; 1]> for GenericArray<T, U1>impl<T> From<[T; 2]> for GenericArray<T, U2>[src]
impl<T> From<[T; 2]> for GenericArray<T, U2>impl<T> From<[T; 3]> for GenericArray<T, U3>[src]
impl<T> From<[T; 3]> for GenericArray<T, U3>impl<T> From<[T; 4]> for GenericArray<T, U4>[src]
impl<T> From<[T; 4]> for GenericArray<T, U4>impl<T> From<[T; 5]> for GenericArray<T, U5>[src]
impl<T> From<[T; 5]> for GenericArray<T, U5>impl<T> From<[T; 6]> for GenericArray<T, U6>[src]
impl<T> From<[T; 6]> for GenericArray<T, U6>impl<T> From<[T; 7]> for GenericArray<T, U7>[src]
impl<T> From<[T; 7]> for GenericArray<T, U7>impl<T> From<[T; 8]> for GenericArray<T, U8>[src]
impl<T> From<[T; 8]> for GenericArray<T, U8>impl<T> From<[T; 9]> for GenericArray<T, U9>[src]
impl<T> From<[T; 9]> for GenericArray<T, U9>impl<T> From<[T; 10]> for GenericArray<T, U10>[src]
impl<T> From<[T; 10]> for GenericArray<T, U10>impl<T> From<[T; 11]> for GenericArray<T, U11>[src]
impl<T> From<[T; 11]> for GenericArray<T, U11>impl<T> From<[T; 12]> for GenericArray<T, U12>[src]
impl<T> From<[T; 12]> for GenericArray<T, U12>impl<T> From<[T; 13]> for GenericArray<T, U13>[src]
impl<T> From<[T; 13]> for GenericArray<T, U13>impl<T> From<[T; 14]> for GenericArray<T, U14>[src]
impl<T> From<[T; 14]> for GenericArray<T, U14>impl<T> From<[T; 15]> for GenericArray<T, U15>[src]
impl<T> From<[T; 15]> for GenericArray<T, U15>impl<T> From<[T; 16]> for GenericArray<T, U16>[src]
impl<T> From<[T; 16]> for GenericArray<T, U16>impl<T> From<[T; 17]> for GenericArray<T, U17>[src]
impl<T> From<[T; 17]> for GenericArray<T, U17>impl<T> From<[T; 18]> for GenericArray<T, U18>[src]
impl<T> From<[T; 18]> for GenericArray<T, U18>impl<T> From<[T; 19]> for GenericArray<T, U19>[src]
impl<T> From<[T; 19]> for GenericArray<T, U19>impl<T> From<[T; 20]> for GenericArray<T, U20>[src]
impl<T> From<[T; 20]> for GenericArray<T, U20>impl<T> From<[T; 21]> for GenericArray<T, U21>[src]
impl<T> From<[T; 21]> for GenericArray<T, U21>impl<T> From<[T; 22]> for GenericArray<T, U22>[src]
impl<T> From<[T; 22]> for GenericArray<T, U22>impl<T> From<[T; 23]> for GenericArray<T, U23>[src]
impl<T> From<[T; 23]> for GenericArray<T, U23>impl<T> From<[T; 24]> for GenericArray<T, U24>[src]
impl<T> From<[T; 24]> for GenericArray<T, U24>impl<T> From<[T; 25]> for GenericArray<T, U25>[src]
impl<T> From<[T; 25]> for GenericArray<T, U25>impl<T> From<[T; 26]> for GenericArray<T, U26>[src]
impl<T> From<[T; 26]> for GenericArray<T, U26>impl<T> From<[T; 27]> for GenericArray<T, U27>[src]
impl<T> From<[T; 27]> for GenericArray<T, U27>impl<T> From<[T; 28]> for GenericArray<T, U28>[src]
impl<T> From<[T; 28]> for GenericArray<T, U28>impl<T> From<[T; 29]> for GenericArray<T, U29>[src]
impl<T> From<[T; 29]> for GenericArray<T, U29>impl<T> From<[T; 30]> for GenericArray<T, U30>[src]
impl<T> From<[T; 30]> for GenericArray<T, U30>impl<T> From<[T; 31]> for GenericArray<T, U31>[src]
impl<T> From<[T; 31]> for GenericArray<T, U31>impl<T> From<[T; 32]> for GenericArray<T, U32>[src]
impl<T> From<[T; 32]> for GenericArray<T, U32>impl<T: Clone, N> Clone for GenericArray<T, N> where
N: ArrayLength<T>, [src]
impl<T: Clone, N> Clone for GenericArray<T, N> where
N: ArrayLength<T>, fn clone(&self) -> GenericArray<T, N>[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[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl<T, N> AsRef<[T]> for GenericArray<T, N> where
N: ArrayLength<T>, [src]
impl<T, N> AsRef<[T]> for GenericArray<T, N> where
N: ArrayLength<T>, impl<T: Default, N> Default for GenericArray<T, N> where
N: ArrayLength<T>, [src]
impl<T: Default, N> Default for GenericArray<T, N> where
N: ArrayLength<T>, impl<T, N> AsMut<[T]> for GenericArray<T, N> where
N: ArrayLength<T>, [src]
impl<T, N> AsMut<[T]> for GenericArray<T, N> where
N: ArrayLength<T>, impl<T, N> Borrow<[T]> for GenericArray<T, N> where
N: ArrayLength<T>, [src]
impl<T, N> Borrow<[T]> for GenericArray<T, N> where
N: ArrayLength<T>, impl<T, N> BorrowMut<[T]> for GenericArray<T, N> where
N: ArrayLength<T>, [src]
impl<T, N> BorrowMut<[T]> for GenericArray<T, N> where
N: ArrayLength<T>, fn borrow_mut(&mut self) -> &mut [T][src]
fn borrow_mut(&mut self) -> &mut [T]Mutably borrows from an owned value. Read more
Auto Trait Implementations
impl<T, U> Send for GenericArray<T, U> where
<U as ArrayLength<T>>::ArrayType: Send,
impl<T, U> Send for GenericArray<T, U> where
<U as ArrayLength<T>>::ArrayType: Send, impl<T, U> Sync for GenericArray<T, U> where
<U as ArrayLength<T>>::ArrayType: Sync,
impl<T, U> Sync for GenericArray<T, U> where
<U as ArrayLength<T>>::ArrayType: Sync, Blanket Implementations
impl<I> IntoIterator for I where
I: Iterator, [src]
impl<I> IntoIterator for I where
I: Iterator, type Item = <I as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = I
Which kind of iterator are we turning this into?
fn into_iter(self) -> I[src]
fn into_iter(self) -> ICreates an iterator from a value. Read more
impl<T, U> TryFrom for T where
T: From<U>, [src]
impl<T, U> TryFrom for T where
T: From<U>, type Error = !
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>try_from)Performs the conversion.
impl<T> From for T[src]
impl<T> From for Timpl<T, U> TryInto for T where
U: TryFrom<T>, [src]
impl<T, U> TryInto for T where
U: TryFrom<T>, type Error = <U as TryFrom<T>>::Error
try_from)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>try_from)Performs the conversion.
impl<T, U> Into for T where
U: From<T>, [src]
impl<T, U> Into for T where
U: From<T>, impl<T> Borrow for T where
T: ?Sized, [src]
impl<T> Borrow for T where
T: ?Sized, impl<T> BorrowMut for T where
T: ?Sized, [src]
impl<T> BorrowMut for T where
T: ?Sized, fn borrow_mut(&mut self) -> &mut T[src]
fn borrow_mut(&mut self) -> &mut TMutably borrows from an owned value. Read more
impl<T> Any for T where
T: 'static + ?Sized, [src]
impl<T> Any for T where
T: 'static + ?Sized, fn get_type_id(&self) -> TypeId[src]
fn get_type_id(&self) -> TypeId🔬 This is a nightly-only experimental API. (get_type_id)
this method will likely be replaced by an associated static
Gets the TypeId of self. Read more
impl<T> Same for T[src]
impl<T> Same for Ttype Output = T
Should always be Self