Trait serialize::DecoderUnstable [-]  [+] [src]

pub trait Decoder<E> {
    fn read_nil(&mut self) -> Result<(), E>;
    fn read_uint(&mut self) -> Result<uint, E>;
    fn read_u64(&mut self) -> Result<u64, E>;
    fn read_u32(&mut self) -> Result<u32, E>;
    fn read_u16(&mut self) -> Result<u16, E>;
    fn read_u8(&mut self) -> Result<u8, E>;
    fn read_int(&mut self) -> Result<int, E>;
    fn read_i64(&mut self) -> Result<i64, E>;
    fn read_i32(&mut self) -> Result<i32, E>;
    fn read_i16(&mut self) -> Result<i16, E>;
    fn read_i8(&mut self) -> Result<i8, E>;
    fn read_bool(&mut self) -> Result<bool, E>;
    fn read_f64(&mut self) -> Result<f64, E>;
    fn read_f32(&mut self) -> Result<f32, E>;
    fn read_char(&mut self) -> Result<char, E>;
    fn read_str(&mut self) -> Result<String, E>;
    fn read_enum<T, F>(&mut self, name: &str, f: F) -> Result<T, E> where F: FnOnce(&mut Self) -> Result<T, E>;
    fn read_enum_variant<T, F>(&mut self, names: &[&str], f: F) -> Result<T, E> where F: FnMut(&mut Self, uint) -> Result<T, E>;
    fn read_enum_variant_arg<T, F>(&mut self, a_idx: uint, f: F) -> Result<T, E> where F: FnOnce(&mut Self) -> Result<T, E>;
    fn read_enum_struct_variant<T, F>(&mut self, names: &[&str], f: F) -> Result<T, E> where F: FnMut(&mut Self, uint) -> Result<T, E>;
    fn read_enum_struct_variant_field<T, F>(&mut self, f_name: &str, f_idx: uint, f: F) -> Result<T, E> where F: FnOnce(&mut Self) -> Result<T, E>;
    fn read_struct<T, F>(&mut self, s_name: &str, len: uint, f: F) -> Result<T, E> where F: FnOnce(&mut Self) -> Result<T, E>;
    fn read_struct_field<T, F>(&mut self, f_name: &str, f_idx: uint, f: F) -> Result<T, E> where F: FnOnce(&mut Self) -> Result<T, E>;
    fn read_tuple<T, F>(&mut self, len: uint, f: F) -> Result<T, E> where F: FnOnce(&mut Self) -> Result<T, E>;
    fn read_tuple_arg<T, F>(&mut self, a_idx: uint, f: F) -> Result<T, E> where F: FnOnce(&mut Self) -> Result<T, E>;
    fn read_tuple_struct<T, F>(&mut self, s_name: &str, len: uint, f: F) -> Result<T, E> where F: FnOnce(&mut Self) -> Result<T, E>;
    fn read_tuple_struct_arg<T, F>(&mut self, a_idx: uint, f: F) -> Result<T, E> where F: FnOnce(&mut Self) -> Result<T, E>;
    fn read_option<T, F>(&mut self, f: F) -> Result<T, E> where F: FnMut(&mut Self, bool) -> Result<T, E>;
    fn read_seq<T, F>(&mut self, f: F) -> Result<T, E> where F: FnOnce(&mut Self, uint) -> Result<T, E>;
    fn read_seq_elt<T, F>(&mut self, idx: uint, f: F) -> Result<T, E> where F: FnOnce(&mut Self) -> Result<T, E>;
    fn read_map<T, F>(&mut self, f: F) -> Result<T, E> where F: FnOnce(&mut Self, uint) -> Result<T, E>;
    fn read_map_elt_key<T, F>(&mut self, idx: uint, f: F) -> Result<T, E> where F: FnOnce(&mut Self) -> Result<T, E>;
    fn read_map_elt_val<T, F>(&mut self, idx: uint, f: F) -> Result<T, E> where F: FnOnce(&mut Self) -> Result<T, E>;
    fn error(&mut self, err: &str) -> E;
}

Required Methods

fn read_nil(&mut self) -> Result<(), E>

fn read_uint(&mut self) -> Result<uint, E>

fn read_u64(&mut self) -> Result<u64, E>

fn read_u32(&mut self) -> Result<u32, E>

fn read_u16(&mut self) -> Result<u16, E>

fn read_u8(&mut self) -> Result<u8, E>

fn read_int(&mut self) -> Result<int, E>

fn read_i64(&mut self) -> Result<i64, E>

fn read_i32(&mut self) -> Result<i32, E>

fn read_i16(&mut self) -> Result<i16, E>

fn read_i8(&mut self) -> Result<i8, E>

fn read_bool(&mut self) -> Result<bool, E>

fn read_f64(&mut self) -> Result<f64, E>

fn read_f32(&mut self) -> Result<f32, E>

fn read_char(&mut self) -> Result<char, E>

fn read_str(&mut self) -> Result<String, E>

fn read_enum<T, F>(&mut self, name: &str, f: F) -> Result<T, E> where F: FnOnce(&mut Self) -> Result<T, E>

fn read_enum_variant<T, F>(&mut self, names: &[&str], f: F) -> Result<T, E> where F: FnMut(&mut Self, uint) -> Result<T, E>

fn read_enum_variant_arg<T, F>(&mut self, a_idx: uint, f: F) -> Result<T, E> where F: FnOnce(&mut Self) -> Result<T, E>

fn read_enum_struct_variant<T, F>(&mut self, names: &[&str], f: F) -> Result<T, E> where F: FnMut(&mut Self, uint) -> Result<T, E>

fn read_enum_struct_variant_field<T, F>(&mut self, f_name: &str, f_idx: uint, f: F) -> Result<T, E> where F: FnOnce(&mut Self) -> Result<T, E>

fn read_struct<T, F>(&mut self, s_name: &str, len: uint, f: F) -> Result<T, E> where F: FnOnce(&mut Self) -> Result<T, E>

fn read_struct_field<T, F>(&mut self, f_name: &str, f_idx: uint, f: F) -> Result<T, E> where F: FnOnce(&mut Self) -> Result<T, E>

fn read_tuple<T, F>(&mut self, len: uint, f: F) -> Result<T, E> where F: FnOnce(&mut Self) -> Result<T, E>

fn read_tuple_arg<T, F>(&mut self, a_idx: uint, f: F) -> Result<T, E> where F: FnOnce(&mut Self) -> Result<T, E>

fn read_tuple_struct<T, F>(&mut self, s_name: &str, len: uint, f: F) -> Result<T, E> where F: FnOnce(&mut Self) -> Result<T, E>

fn read_tuple_struct_arg<T, F>(&mut self, a_idx: uint, f: F) -> Result<T, E> where F: FnOnce(&mut Self) -> Result<T, E>

fn read_option<T, F>(&mut self, f: F) -> Result<T, E> where F: FnMut(&mut Self, bool) -> Result<T, E>

fn read_seq<T, F>(&mut self, f: F) -> Result<T, E> where F: FnOnce(&mut Self, uint) -> Result<T, E>

fn read_seq_elt<T, F>(&mut self, idx: uint, f: F) -> Result<T, E> where F: FnOnce(&mut Self) -> Result<T, E>

fn read_map<T, F>(&mut self, f: F) -> Result<T, E> where F: FnOnce(&mut Self, uint) -> Result<T, E>

fn read_map_elt_key<T, F>(&mut self, idx: uint, f: F) -> Result<T, E> where F: FnOnce(&mut Self) -> Result<T, E>

fn read_map_elt_val<T, F>(&mut self, idx: uint, f: F) -> Result<T, E> where F: FnOnce(&mut Self) -> Result<T, E>

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

Implementors