use super::*; #[derive(Debug)] pub struct CborFormatter; impl Format for CborFormatter { fn encode(_cfg: &Config, to: W, obj: &Object) -> Result { let mut to = to.with_counter(); serde_cbor::to_writer(&mut to, obj)?; Ok(to.count()) } fn decode(_cfg: &Config, from: R) -> Result { Ok(serde_cbor::from_reader(from)?) } }