# [−][src]Trait serde::de::SeqAccess

    pub trait SeqAccess<'de> {
        type Error: Error;
        fn next_element_seed<T>(
            &mut self,
            seed: T
        ) -> Result<Option<T::Value>, Self::Error>
        where
            T: DeserializeSeed<'de>;

        fn next_element<T>(&mut self) -> Result<Option<T>, Self::Error>
        where
            T: Deserialize<'de>,
        { ... }
        fn size_hint(&self) -> Option<usize> { ... }
    }

Provides a `Visitor` access to each element of a sequence in the input.

This is a trait that a `Deserializer` passes to a `Visitor` implementation, which deserializes each item in a sequence.

# Lifetime

The `'de` lifetime of this trait is the lifetime of data that may be borrowed by deserialized sequence elements. See the page Understanding deserializer lifetimes for a more detailed explanation of these lifetimes.

# Example implementation

The example data format presented on the website demonstrates an implementation of `SeqAccess` for a basic JSON data format.

## Associated Types

### `type Error: Error`

The error type that can be returned if some error occurs during deserialization.

Loading content...

## Required methods

### `fn next_element_seed<T>(
&mut self,
seed: T
) -> Result<Option<T::Value>, Self::Error> where
T: DeserializeSeed<'de>,`

This returns `Ok(Some(value))` for the next value in the sequence, or `Ok(None)` if there are no more remaining items.

`Deserialize` implementations should typically use `SeqAccess::next_element` instead.

Loading content...

## Provided methods

### `fn next_element<T>(&mut self) -> Result<Option<T>, Self::Error> where
T: Deserialize<'de>,`

This returns `Ok(Some(value))` for the next value in the sequence, or `Ok(None)` if there are no more remaining items.

This method exists as a convenience for `Deserialize` implementations. `SeqAccess` implementations should not override the default behavior.

### `fn size_hint(&self) -> Option<usize>`

Returns the number of elements remaining in the sequence, if known.

Loading content...

## Implementations on Foreign Types

### `impl<'de, 'a, A> SeqAccess<'de> for &'a mut A where
A: SeqAccess<'de>,` [src]

#### `type Error = A::Error`

#### `fn next_element_seed<T>(
&mut self,
seed: T
) -> Result<Option<T::Value>, Self::Error> where
T: DeserializeSeed<'de>,` [src]

#### `fn next_element<T>(&mut self) -> Result<Option<T>, Self::Error> where
T: Deserialize<'de>,` [src]

#### `fn size_hint(&self) -> Option<usize>`[src]

Loading content...

## Implementors

### `impl<'de, I, E> SeqAccess<'de> for MapDeserializer<'de, I, E> where
I: Iterator,
I::Item: Pair,
<I::Item as Pair>::First: IntoDeserializer<'de, E>,
<I::Item as Pair>::Second: IntoDeserializer<'de, E>,
E: Error,` [src]

#### `type Error = E`

#### `fn next_element_seed<T>(
&mut self,
seed: T
) -> Result<Option<T::Value>, Self::Error> where
T: DeserializeSeed<'de>,` [src]

#### `fn size_hint(&self) -> Option<usize>`[src]

### `impl<'de, I, T, E> SeqAccess<'de> for SeqDeserializer<I, E> where
I: Iterator<Item = T>,
T: IntoDeserializer<'de, E>,
E: Error,` [src]

#### `type Error = E`

#### `fn next_element_seed<V>(
&mut self,
seed: V
) -> Result<Option<V::Value>, Self::Error> where
V: DeserializeSeed<'de>,` [src]

#### `fn size_hint(&self) -> Option<usize>`[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`)