Struct serde_json::de::Deserializer [] [src]

pub struct Deserializer<Iter: Iterator<Item=Result<u8>>> {
    // some fields omitted
}

A structure that deserializes JSON into Rust values.

Methods

impl<Iter> Deserializer<Iter> where Iter: Iterator<Item=Result<u8>>

fn new(rdr: Iter) -> Deserializer<Iter>

Creates the JSON parser from an std::iter::Iterator.

fn end(&mut self) -> Result<()>

The Deserializer::end method should be called after a value has been fully deserialized. This allows the Deserializer to validate that the input stream is at the end or that it only has trailing whitespace.

Trait Implementations

impl<Iter> Deserializer for Deserializer<Iter> where Iter: Iterator<Item=Result<u8>>

type Error = Error

fn deserialize<V>(&mut self, visitor: V) -> Result<V::Value> where V: Visitor

fn deserialize_option<V>(&mut self, visitor: V) -> Result<V::Value> where V: Visitor

Parses a null as a None, and any other values as a Some(...).

fn deserialize_newtype_struct<V>(&mut self, _name: &str, visitor: V) -> Result<V::Value> where V: Visitor

Parses a newtype struct as the underlying value.

fn deserialize_enum<V>(&mut self, _name: &str, _variants: &'static [&'static str], visitor: V) -> Result<V::Value> where V: EnumVisitor

Parses an enum as an object like {"$KEY":$VALUE}, where $VALUE is either a straight value, a [..], or a {..}.

fn deserialize_bool<V>(&mut self, visitor: V) -> Result<V::Value, Self::Error> where V: Visitor

fn deserialize_usize<V>(&mut self, visitor: V) -> Result<V::Value, Self::Error> where V: Visitor

fn deserialize_u8<V>(&mut self, visitor: V) -> Result<V::Value, Self::Error> where V: Visitor

fn deserialize_u16<V>(&mut self, visitor: V) -> Result<V::Value, Self::Error> where V: Visitor

fn deserialize_u32<V>(&mut self, visitor: V) -> Result<V::Value, Self::Error> where V: Visitor

fn deserialize_u64<V>(&mut self, visitor: V) -> Result<V::Value, Self::Error> where V: Visitor

fn deserialize_isize<V>(&mut self, visitor: V) -> Result<V::Value, Self::Error> where V: Visitor

fn deserialize_i8<V>(&mut self, visitor: V) -> Result<V::Value, Self::Error> where V: Visitor

fn deserialize_i16<V>(&mut self, visitor: V) -> Result<V::Value, Self::Error> where V: Visitor

fn deserialize_i32<V>(&mut self, visitor: V) -> Result<V::Value, Self::Error> where V: Visitor

fn deserialize_i64<V>(&mut self, visitor: V) -> Result<V::Value, Self::Error> where V: Visitor

fn deserialize_f32<V>(&mut self, visitor: V) -> Result<V::Value, Self::Error> where V: Visitor

fn deserialize_f64<V>(&mut self, visitor: V) -> Result<V::Value, Self::Error> where V: Visitor

fn deserialize_char<V>(&mut self, visitor: V) -> Result<V::Value, Self::Error> where V: Visitor

fn deserialize_str<V>(&mut self, visitor: V) -> Result<V::Value, Self::Error> where V: Visitor

fn deserialize_string<V>(&mut self, visitor: V) -> Result<V::Value, Self::Error> where V: Visitor

fn deserialize_unit<V>(&mut self, visitor: V) -> Result<V::Value, Self::Error> where V: Visitor

fn deserialize_seq<V>(&mut self, visitor: V) -> Result<V::Value, Self::Error> where V: Visitor

fn deserialize_fixed_size_array<V>(&mut self, _len: usize, visitor: V) -> Result<V::Value, Self::Error> where V: Visitor

fn deserialize_bytes<V>(&mut self, visitor: V) -> Result<V::Value, Self::Error> where V: Visitor

fn deserialize_map<V>(&mut self, visitor: V) -> Result<V::Value, Self::Error> where V: Visitor

fn deserialize_unit_struct<V>(&mut self, _name: &'static str, visitor: V) -> Result<V::Value, Self::Error> where V: Visitor

fn deserialize_tuple_struct<V>(&mut self, _name: &'static str, len: usize, visitor: V) -> Result<V::Value, Self::Error> where V: Visitor

fn deserialize_struct<V>(&mut self, _name: &'static str, _fields: &'static [&'static str], visitor: V) -> Result<V::Value, Self::Error> where V: Visitor

fn deserialize_struct_field<V>(&mut self, visitor: V) -> Result<V::Value, Self::Error> where V: Visitor

fn deserialize_tuple<V>(&mut self, _len: usize, visitor: V) -> Result<V::Value, Self::Error> where V: Visitor

fn deserialize_ignored_any<V>(&mut self, visitor: V) -> Result<V::Value, Self::Error> where V: Visitor

impl<Iter> VariantVisitor for Deserializer<Iter> where Iter: Iterator<Item=Result<u8>>

type Error = Error

fn visit_variant<V>(&mut self) -> Result<V> where V: Deserialize

fn visit_unit(&mut self) -> Result<()>

fn visit_newtype<T>(&mut self) -> Result<T> where T: Deserialize

fn visit_tuple<V>(&mut self, _len: usize, visitor: V) -> Result<V::Value> where V: Visitor

fn visit_struct<V>(&mut self, _fields: &'static [&'static str], visitor: V) -> Result<V::Value> where V: Visitor