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]
impl<T, Iter> SeqIteratorVisitor<Iter> where
Iter: Iterator<Item = T>,
pub fn new(iter: Iter, len: Option<usize>) -> SeqIteratorVisitor<Iter>
[src]
pub fn new(iter: Iter, len: Option<usize>) -> SeqIteratorVisitor<Iter>
Construct a new SeqIteratorVisitor<Iter>
.
Trait Implementations
impl<T, Iter> SeqVisitor for SeqIteratorVisitor<Iter> where
T: Serialize,
Iter: Iterator<Item = T>,
[src]
impl<T, Iter> SeqVisitor for SeqIteratorVisitor<Iter> where
T: Serialize,
Iter: Iterator<Item = T>,
Auto Trait Implementations
impl<Iter> Send for SeqIteratorVisitor<Iter> where
Iter: Send,
impl<Iter> Send for SeqIteratorVisitor<Iter> where
Iter: Send,
impl<Iter> Sync for SeqIteratorVisitor<Iter> where
Iter: Sync,
impl<Iter> Sync for SeqIteratorVisitor<Iter> where
Iter: Sync,