[−]Trait skellige::prelude::blake2::crypto_mac::generic_array::sequence::Lengthen
Defines any GenericSequence
which can be lengthened or extended by appending
or prepending an element to it.
Any lengthened sequence can be shortened back to the original using pop_front
or pop_back
Associated Types
Loading content...Required methods
pub fn append(self, last: T) -> Self::Longer
Returns a new array with the given element appended to the end of it.
Example:
let a = arr![i32; 1, 2, 3]; let b = a.append(4); assert_eq!(b, arr![i32; 1, 2, 3, 4]);
pub fn prepend(self, first: T) -> Self::Longer
Returns a new array with the given element prepended to the front of it.
Example:
let a = arr![i32; 1, 2, 3]; let b = a.prepend(4); assert_eq!(b, arr![i32; 4, 1, 2, 3]);
Implementors
impl<T, N> Lengthen<T> for GenericArray<T, N> where
N: ArrayLength<T> + Add<B1>,
<N as Add<B1>>::Output: ArrayLength<T>,
<N as Add<B1>>::Output: Sub<B1>,
<<N as Add<B1>>::Output as Sub<B1>>::Output: ArrayLength<T>,
<<N as Add<B1>>::Output as Sub<B1>>::Output == N,
N: ArrayLength<T> + Add<B1>,
<N as Add<B1>>::Output: ArrayLength<T>,
<N as Add<B1>>::Output: Sub<B1>,
<<N as Add<B1>>::Output as Sub<B1>>::Output: ArrayLength<T>,
<<N as Add<B1>>::Output as Sub<B1>>::Output == N,