Trait GenericSequence

unsafe trait GenericSequence<T>: Sized + IntoIterator

Defines some sequence with an associated length and iteration capabilities.

This is useful for passing N-length generic arrays as generics.

Associated Types

type Length: TraitBound { trait_: Path { path: "ArrayLength", id: Id(4), args: Some(AngleBracketed { args: [Type(Generic("T"))], constraints: [] }) }, generic_params: [], modifier: None }

GenericArray associated length

type Sequence: TraitBound { trait_: Path { path: "GenericSequence", id: Id(13), args: Some(AngleBracketed { args: [Type(Generic("T"))], constraints: [AssocItemConstraint { name: "Length", args: None, binding: Equality(Type(QualifiedPath { name: "Length", args: None, self_type: Generic("Self"), trait_: Some(Path { path: "", id: Id(13), args: None }) })) }] }) }, generic_params: [], modifier: None } + TraitBound { trait_: Path { path: "FromIterator", id: Id(127), args: Some(AngleBracketed { args: [Type(Generic("T"))], constraints: [] }) }, generic_params: [], modifier: None }

Concrete sequence type used in conjuction with reference implementations of GenericSequence

Required Methods

fn generate<F>(f: F) -> <Self as >::Sequence
where
    F: FnMut(usize) -> T

Initializes a new sequence instance using the given function.

If the generator function panics while initializing the sequence, any already initialized elements will be dropped.

Implementors