use postcard_1_0::{from_bytes, to_allocvec, Error}; use serde::{Deserialize, Serialize}; pub struct PostCard; impl super::Encode for PostCard { type Error = Error; fn encode(obj: &T) -> Result, Error> { Ok(to_allocvec(obj)?) } } impl Deserialize<'a>> super::Decode for PostCard { type Error = Error; fn decode(data: Vec) -> Result { Ok(from_bytes(&data)?) } }