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]

[src]

Extracts a slice containing the entire array.

[src]

Extracts a mutable slice containing the entire array.

[src]

Converts slice to a generic array reference with inferred length;

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

[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]

[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]

[src]

Creates a new GenericArray instance from an iterator with a known exact size.

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

Trait Implementations

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

[src]

Formats the value using the given formatter.

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

[src]

Formats the value using the given formatter.

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

[src]

Returns the "default value" for a type. Read more

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

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

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

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

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

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]

[src]

This method returns an ordering between self and other values if one exists. Read more

1.0.0
[src]

This method tests less than (for self and other) and is used by the < operator. Read more

1.0.0
[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

1.0.0
[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

1.0.0
[src]

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]

[src]

This method returns an Ordering between self and other. Read more

1.21.0
[src]

Compares and returns the maximum of two values. Read more

1.21.0
[src]

Compares and returns the minimum of two values. Read more

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

[src]

Formats the value using the given formatter. Read more

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

[src]

Immutably borrows from an owned value. Read more

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

[src]

Mutably borrows from an owned value. Read more

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

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

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

[src]

Creates an iterator from a value. Read more

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]

GenericSequence that has one more element than Self

[src]

Returns a new array with the given element appended to the end of it. Read more

[src]

Returns a new array with the given element prepended to the front of it. Read more

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]

GenericSequence that has one less element than Self

[src]

Returns a new array without the last element, and the last element. Read more

[src]

Returns a new array without the first element, and the first element. Example: Read more

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]

First part of the resulting split array

Second part of the resulting split array

[src]

Splits an array at the given index, returning the separate parts of the array.

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]

Sequence to be concatenated with self

Resulting sequence formed by the concatenation.

[src]

Concatenate, or join, two sequences.

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

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

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

The resulting type after dereferencing.

[src]

Dereferences the value.

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

[src]

Mutably dereferences the value.

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

Which kind of iterator are we turning this into?

The type of the elements being iterated over.

[src]

Creates an iterator from a value. Read more

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

Which kind of iterator are we turning this into?

The type of the elements being iterated over.

[src]

Creates an iterator from a value. Read more

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

[src]

Creates a value from an iterator. Read more

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

GenericArray associated length

Concrete sequence type used in conjuction with reference implementations of GenericSequence

[src]

Initializes a new sequence instance using the given function. Read more

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]

Mapped sequence type

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

[src]

Maps a GenericSequence to another GenericSequence. Read more

[src]

Combines two GenericSequence instances and iterates through both of them, initializing a new GenericSequence with the result of the zipped mapping function. Read more

[src]

Folds (or reduces) a sequence of data into a single value. Read more

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

[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, N: ArrayLength<T>> From<&'a mut [T]> for &'a mut GenericArray<T, N>
[src]

[src]

Converts mutable slice to a mutable generic array reference

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