Struct bincode::serde::Deserializer [] [src]

pub struct Deserializer<'a, R: 'a> {
    // some fields omitted
}

A Deserializer that reads bytes from a buffer.

This struct should rarely be used. In most cases, prefer the decode_from function.

let d = Deserializer::new(&mut some_reader, SizeLimit::new());
serde::Deserialize::deserialize(&mut deserializer);
let bytes_read = d.bytes_read();

Methods

impl<'a, R: Read> Deserializer<'a, R>

fn new(r: &'a mut R, size_limit: SizeLimit) -> Deserializer<'a, R>

fn bytes_read(&self) -> u64

Returns the number of bytes read from the contained Reader.

Trait Implementations

impl<'a, R: Read> Deserializer for Deserializer<'a, R>

type Error = DeserializeError

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

fn deserialize_struct<V>(&mut self, _name: &str, fields: &'static [&'static str], visitor: V) -> DeserializeResult<V::Value> where V: Visitor

fn deserialize_newtype_struct<V>(&mut self, _name: &str, 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_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_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_field<V>(&mut self, 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<'a, R: Read> VariantVisitor for Deserializer<'a, R>

type Error = DeserializeError

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

fn visit_unit(&mut self) -> Result<(), Self::Error>

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

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

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