Struct serde::ser::impls::SeqIteratorVisitor[][src]

pub struct SeqIteratorVisitor<Iter> { /* fields omitted */ }

A serde::Visitor for sequence iterators.

Examples

use serde::{Serialize, Serializer};
use serde::ser::impls::SeqIteratorVisitor;

struct Seq(Vec<u32>);

impl Serialize for Seq {
    fn serialize<S>(&self, ser: &mut S) -> Result<(), S::Error>
        where S: Serializer,
    {
        ser.visit_seq(SeqIteratorVisitor::new(
            self.0.iter(),
            Some(self.0.len()),
        ))
    }
}

Methods

impl<T, Iter> SeqIteratorVisitor<Iter> where
    Iter: Iterator<Item = T>, 
[src]

Construct a new SeqIteratorVisitor<Iter>.

Trait Implementations

impl<T, Iter> SeqVisitor for SeqIteratorVisitor<Iter> where
    T: Serialize,
    Iter: Iterator<Item = T>, 
[src]

Serializes a sequence item in the serializer. Read more

Return the length of the sequence if known.

Auto Trait Implementations

impl<Iter> Send for SeqIteratorVisitor<Iter> where
    Iter: Send

impl<Iter> Sync for SeqIteratorVisitor<Iter> where
    Iter: Sync