[src]

Trait serialize::Encoder

pub trait Encoder<E> {
    fn emit_nil(&mut self) -> Result<(), E>;
    fn emit_uint(&mut self, v: uint) -> Result<(), E>;
    fn emit_u64(&mut self, v: u64) -> Result<(), E>;
    fn emit_u32(&mut self, v: u32) -> Result<(), E>;
    fn emit_u16(&mut self, v: u16) -> Result<(), E>;
    fn emit_u8(&mut self, v: u8) -> Result<(), E>;
    fn emit_int(&mut self, v: int) -> Result<(), E>;
    fn emit_i64(&mut self, v: i64) -> Result<(), E>;
    fn emit_i32(&mut self, v: i32) -> Result<(), E>;
    fn emit_i16(&mut self, v: i16) -> Result<(), E>;
    fn emit_i8(&mut self, v: i8) -> Result<(), E>;
    fn emit_bool(&mut self, v: bool) -> Result<(), E>;
    fn emit_f64(&mut self, v: f64) -> Result<(), E>;
    fn emit_f32(&mut self, v: f32) -> Result<(), E>;
    fn emit_char(&mut self, v: char) -> Result<(), E>;
    fn emit_str(&mut self, v: &str) -> Result<(), E>;
    fn emit_enum(&mut self, name: &str, f: |&mut Self| -> Result<(), E>) -> Result<(), E>;
    fn emit_enum_variant(&mut self, v_name: &str, v_id: uint, len: uint, f: |&mut Self| -> Result<(), E>) -> Result<(), E>;
    fn emit_enum_variant_arg(&mut self, a_idx: uint, f: |&mut Self| -> Result<(), E>) -> Result<(), E>;
    fn emit_enum_struct_variant(&mut self, v_name: &str, v_id: uint, len: uint, f: |&mut Self| -> Result<(), E>) -> Result<(), E>;
    fn emit_enum_struct_variant_field(&mut self, f_name: &str, f_idx: uint, f: |&mut Self| -> Result<(), E>) -> Result<(), E>;
    fn emit_struct(&mut self, name: &str, len: uint, f: |&mut Self| -> Result<(), E>) -> Result<(), E>;
    fn emit_struct_field(&mut self, f_name: &str, f_idx: uint, f: |&mut Self| -> Result<(), E>) -> Result<(), E>;
    fn emit_tuple(&mut self, len: uint, f: |&mut Self| -> Result<(), E>) -> Result<(), E>;
    fn emit_tuple_arg(&mut self, idx: uint, f: |&mut Self| -> Result<(), E>) -> Result<(), E>;
    fn emit_tuple_struct(&mut self, name: &str, len: uint, f: |&mut Self| -> Result<(), E>) -> Result<(), E>;
    fn emit_tuple_struct_arg(&mut self, f_idx: uint, f: |&mut Self| -> Result<(), E>) -> Result<(), E>;
    fn emit_option(&mut self, f: |&mut Self| -> Result<(), E>) -> Result<(), E>;
    fn emit_option_none(&mut self) -> Result<(), E>;
    fn emit_option_some(&mut self, f: |&mut Self| -> Result<(), E>) -> Result<(), E>;
    fn emit_seq(&mut self, len: uint, f: |this: &mut Self| -> Result<(), E>) -> Result<(), E>;
    fn emit_seq_elt(&mut self, idx: uint, f: |this: &mut Self| -> Result<(), E>) -> Result<(), E>;
    fn emit_map(&mut self, len: uint, f: |&mut Self| -> Result<(), E>) -> Result<(), E>;
    fn emit_map_elt_key(&mut self, idx: uint, f: |&mut Self| -> Result<(), E>) -> Result<(), E>;
    fn emit_map_elt_val(&mut self, idx: uint, f: |&mut Self| -> Result<(), E>) -> Result<(), E>;
}

Required Methods

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

fn emit_uint(&mut self, v: uint) -> Result<(), E>

fn emit_u64(&mut self, v: u64) -> Result<(), E>

fn emit_u32(&mut self, v: u32) -> Result<(), E>

fn emit_u16(&mut self, v: u16) -> Result<(), E>

fn emit_u8(&mut self, v: u8) -> Result<(), E>

fn emit_int(&mut self, v: int) -> Result<(), E>

fn emit_i64(&mut self, v: i64) -> Result<(), E>

fn emit_i32(&mut self, v: i32) -> Result<(), E>

fn emit_i16(&mut self, v: i16) -> Result<(), E>

fn emit_i8(&mut self, v: i8) -> Result<(), E>

fn emit_bool(&mut self, v: bool) -> Result<(), E>

fn emit_f64(&mut self, v: f64) -> Result<(), E>

fn emit_f32(&mut self, v: f32) -> Result<(), E>

fn emit_char(&mut self, v: char) -> Result<(), E>

fn emit_str(&mut self, v: &str) -> Result<(), E>

fn emit_enum(&mut self, name: &str, f: |&mut Self| -> Result<(), E>) -> Result<(), E>

fn emit_enum_variant(&mut self, v_name: &str, v_id: uint, len: uint, f: |&mut Self| -> Result<(), E>) -> Result<(), E>

fn emit_enum_variant_arg(&mut self, a_idx: uint, f: |&mut Self| -> Result<(), E>) -> Result<(), E>

fn emit_enum_struct_variant(&mut self, v_name: &str, v_id: uint, len: uint, f: |&mut Self| -> Result<(), E>) -> Result<(), E>

fn emit_enum_struct_variant_field(&mut self, f_name: &str, f_idx: uint, f: |&mut Self| -> Result<(), E>) -> Result<(), E>

fn emit_struct(&mut self, name: &str, len: uint, f: |&mut Self| -> Result<(), E>) -> Result<(), E>

fn emit_struct_field(&mut self, f_name: &str, f_idx: uint, f: |&mut Self| -> Result<(), E>) -> Result<(), E>

fn emit_tuple(&mut self, len: uint, f: |&mut Self| -> Result<(), E>) -> Result<(), E>

fn emit_tuple_arg(&mut self, idx: uint, f: |&mut Self| -> Result<(), E>) -> Result<(), E>

fn emit_tuple_struct(&mut self, name: &str, len: uint, f: |&mut Self| -> Result<(), E>) -> Result<(), E>

fn emit_tuple_struct_arg(&mut self, f_idx: uint, f: |&mut Self| -> Result<(), E>) -> Result<(), E>

fn emit_option(&mut self, f: |&mut Self| -> Result<(), E>) -> Result<(), E>

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

fn emit_option_some(&mut self, f: |&mut Self| -> Result<(), E>) -> Result<(), E>

fn emit_seq(&mut self, len: uint, f: |this: &mut Self| -> Result<(), E>) -> Result<(), E>

fn emit_seq_elt(&mut self, idx: uint, f: |this: &mut Self| -> Result<(), E>) -> Result<(), E>

fn emit_map(&mut self, len: uint, f: |&mut Self| -> Result<(), E>) -> Result<(), E>

fn emit_map_elt_key(&mut self, idx: uint, f: |&mut Self| -> Result<(), E>) -> Result<(), E>

fn emit_map_elt_val(&mut self, idx: uint, f: |&mut Self| -> Result<(), E>) -> Result<(), E>

Implementors