1
Fork 0

Add cfg attrs to handle auto_encode transition

This commit is contained in:
Brian Anderson 2013-01-14 13:17:20 -08:00
parent fc582bcfce
commit f1d0478002
4 changed files with 58 additions and 0 deletions

View file

@ -58,6 +58,11 @@ pub trait Encoder {
fn emit_vec_elt(&self, idx: uint, f: fn());
fn emit_rec(&self, f: fn());
#[cfg(stage0)]
fn emit_struct(&self, name: &str, f: fn());
#[cfg(stage1)]
#[cfg(stage2)]
#[cfg(stage3)]
fn emit_struct(&self, name: &str, _len: uint, f: fn());
fn emit_field(&self, f_name: &str, f_idx: uint, f: fn());
@ -99,6 +104,11 @@ pub trait Decoder {
fn read_vec_elt<T>(&self, idx: uint, f: fn() -> T) -> T;
fn read_rec<T>(&self, f: fn() -> T) -> T;
#[cfg(stage0)]
fn read_struct<T>(&self, name: &str, f: fn() -> T) -> T;
#[cfg(stage1)]
#[cfg(stage2)]
#[cfg(stage3)]
fn read_struct<T>(&self, name: &str, _len: uint, f: fn() -> T) -> T;
fn read_field<T>(&self, name: &str, idx: uint, f: fn() -> T) -> T;