# [−][src]Trait generic_array::sequence::GenericSequence

    pub unsafe trait GenericSequence<T>: Sized + IntoIterator {
        type Length: ArrayLength<T>;
        type Sequence: GenericSequence<T, Length = Self::Length> + FromIterator<T>;
        fn generate<F>(f: F) -> Self::Sequence
        where
            F: FnMut(usize) -> T;
    }

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: ArrayLength<T>`

`GenericArray` associated length

### `type Sequence: GenericSequence<T, Length = Self::Length> + FromIterator<T>`

Concrete sequence type used in conjuction with reference implementations of `GenericSequence`

Loading content...

## Required methods

### `fn generate<F>(f: F) -> Self::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.

Loading content...

## Implementors

### `impl<'a, T: 'a, S: GenericSequence<T>> GenericSequence<T> for &'a S where
&'a S: IntoIterator,` [src]

#### `type Length = S::Length`

#### `type Sequence = S::Sequence`

#### `fn generate<F>(f: F) -> Self::Sequence where
F: FnMut(usize) -> T,` [src]

### `impl<'a, T: 'a, S: GenericSequence<T>> GenericSequence<T> for &'a mut S where
&'a mut S: IntoIterator,` [src]

#### `type Length = S::Length`

#### `type Sequence = S::Sequence`

#### `fn generate<F>(f: F) -> Self::Sequence where
F: FnMut(usize) -> T,` [src]

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

#### `type Length = N`

#### `type Sequence = Self`

#### `fn generate<F>(f: F) -> GenericArray<T, N> where
F: FnMut(usize) -> T,` [src]

Loading content...

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g., `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g., `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g., `str,u8` or `String,struct:Vec,test`)