1 2 3 4 5 6 7 8 9 10
use {BVEncodeResult, BVDecodeResult}; pub trait ByteEncodable { fn get_size(&self) -> Option<u32>; fn encode(&self) -> BVEncodeResult<Vec<u8>>; } pub trait ByteDecodable: Sized { fn decode(bytes: &[u8]) -> BVDecodeResult<Self>; }