Struct bincode::rustc_serialize::DecoderReader [] [src]

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

A Decoder that reads bytes from a buffer.

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

let dr = bincode::rustc_serialize::DecoderReader::new(&mut some_reader, SizeLimit::Infinite);
let result: T = Decodable::decode(&mut dr);
let bytes_read = dr.bytes_read();

Methods

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

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

fn bytes_read(&self) -> u64

Returns the number of bytes read from the contained Reader.

Trait Implementations

impl<'a, R: Read> Decoder for DecoderReader<'a, R>

type Error = DecodingError

fn read_nil(&mut self) -> DecodingResult<()>

fn read_usize(&mut self) -> DecodingResult<usize>

fn read_u64(&mut self) -> DecodingResult<u64>

fn read_u32(&mut self) -> DecodingResult<u32>

fn read_u16(&mut self) -> DecodingResult<u16>

fn read_u8(&mut self) -> DecodingResult<u8>

fn read_isize(&mut self) -> DecodingResult<isize>

fn read_i64(&mut self) -> DecodingResult<i64>

fn read_i32(&mut self) -> DecodingResult<i32>

fn read_i16(&mut self) -> DecodingResult<i16>

fn read_i8(&mut self) -> DecodingResult<i8>

fn read_bool(&mut self) -> DecodingResult<bool>

fn read_f64(&mut self) -> DecodingResult<f64>

fn read_f32(&mut self) -> DecodingResult<f32>

fn read_char(&mut self) -> DecodingResult<char>

fn read_str(&mut self) -> DecodingResult<String>

fn read_enum<T, F>(&mut self, _: &str, f: F) -> DecodingResult<T> where F: FnOnce(&mut DecoderReader<'a, R>) -> DecodingResult<T>

fn read_enum_variant<T, F>(&mut self, names: &[&str], f: F) -> DecodingResult<T> where F: FnMut(&mut DecoderReader<'a, R>, usize) -> DecodingResult<T>

fn read_enum_variant_arg<T, F>(&mut self, _: usize, f: F) -> DecodingResult<T> where F: FnOnce(&mut DecoderReader<'a, R>) -> DecodingResult<T>

fn read_enum_struct_variant<T, F>(&mut self, names: &[&str], f: F) -> DecodingResult<T> where F: FnMut(&mut DecoderReader<'a, R>, usize) -> DecodingResult<T>

fn read_enum_struct_variant_field<T, F>(&mut self, _: &str, f_idx: usize, f: F) -> DecodingResult<T> where F: FnOnce(&mut DecoderReader<'a, R>) -> DecodingResult<T>

fn read_struct<T, F>(&mut self, _: &str, _: usize, f: F) -> DecodingResult<T> where F: FnOnce(&mut DecoderReader<'a, R>) -> DecodingResult<T>

fn read_struct_field<T, F>(&mut self, _: &str, _: usize, f: F) -> DecodingResult<T> where F: FnOnce(&mut DecoderReader<'a, R>) -> DecodingResult<T>

fn read_tuple<T, F>(&mut self, _: usize, f: F) -> DecodingResult<T> where F: FnOnce(&mut DecoderReader<'a, R>) -> DecodingResult<T>

fn read_tuple_arg<T, F>(&mut self, _: usize, f: F) -> DecodingResult<T> where F: FnOnce(&mut DecoderReader<'a, R>) -> DecodingResult<T>

fn read_tuple_struct<T, F>(&mut self, _: &str, len: usize, f: F) -> DecodingResult<T> where F: FnOnce(&mut DecoderReader<'a, R>) -> DecodingResult<T>

fn read_tuple_struct_arg<T, F>(&mut self, a_idx: usize, f: F) -> DecodingResult<T> where F: FnOnce(&mut DecoderReader<'a, R>) -> DecodingResult<T>

fn read_option<T, F>(&mut self, f: F) -> DecodingResult<T> where F: FnMut(&mut DecoderReader<'a, R>, bool) -> DecodingResult<T>

fn read_seq<T, F>(&mut self, f: F) -> DecodingResult<T> where F: FnOnce(&mut DecoderReader<'a, R>, usize) -> DecodingResult<T>

fn read_seq_elt<T, F>(&mut self, _: usize, f: F) -> DecodingResult<T> where F: FnOnce(&mut DecoderReader<'a, R>) -> DecodingResult<T>

fn read_map<T, F>(&mut self, f: F) -> DecodingResult<T> where F: FnOnce(&mut DecoderReader<'a, R>, usize) -> DecodingResult<T>

fn read_map_elt_key<T, F>(&mut self, _: usize, f: F) -> DecodingResult<T> where F: FnOnce(&mut DecoderReader<'a, R>) -> DecodingResult<T>

fn read_map_elt_val<T, F>(&mut self, _: usize, f: F) -> DecodingResult<T> where F: FnOnce(&mut DecoderReader<'a, R>) -> DecodingResult<T>

fn error(&mut self, err: &str) -> DecodingError