Trait generic_array::sequence::GenericSequence
source · pub unsafe trait GenericSequence<T>: Sized + IntoIterator {
type Length: ArrayLength;
type Sequence: GenericSequence<T, Length = Self::Length> + FromIterator<T>;
// Required method
fn generate<F>(f: F) -> Self::Sequence
where F: FnMut(usize) -> T;
}
Expand description
Defines some sequence with an associated length and iteration capabilities.
This is useful for passing N-length generic arrays as generics.
§Safety
Care must be taken when implementing such that methods are safe.
Lengths must match, and element drop on panic must be handled.
Required Associated Types§
sourcetype Length: ArrayLength
type Length: ArrayLength
GenericArray
associated length
sourcetype Sequence: GenericSequence<T, Length = Self::Length> + FromIterator<T>
type Sequence: GenericSequence<T, Length = Self::Length> + FromIterator<T>
Owned sequence type used in conjuction with reference implementations of GenericSequence
Required Methods§
Object Safety§
This trait is not object safe.
Implementations on Foreign Types§
source§impl<'a, T: 'a, S: GenericSequence<T>> GenericSequence<T> for &'a Swhere
&'a S: IntoIterator,
impl<'a, T: 'a, S: GenericSequence<T>> GenericSequence<T> for &'a Swhere
&'a S: IntoIterator,
source§impl<'a, T: 'a, S: GenericSequence<T>> GenericSequence<T> for &'a mut Swhere
&'a mut S: IntoIterator,
impl<'a, T: 'a, S: GenericSequence<T>> GenericSequence<T> for &'a mut Swhere
&'a mut S: IntoIterator,
source§impl<T, N: ArrayLength> GenericSequence<T> for Box<GenericArray<T, N>>
Available on crate feature alloc
only.
impl<T, N: ArrayLength> GenericSequence<T> for Box<GenericArray<T, N>>
Available on crate feature
alloc
only.