pub unsafe trait GenericSequence<T>: Sized + IntoIterator {
type Length: ArrayLength<T>;
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.
Required Associated Types§
Sourcetype Length: ArrayLength<T>
type Length: ArrayLength<T>
GenericArray
associated length
Sourcetype Sequence: GenericSequence<T, Length = Self::Length> + FromIterator<T>
type Sequence: GenericSequence<T, Length = Self::Length> + FromIterator<T>
Concrete sequence type used in conjuction with reference implementations of GenericSequence
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.