use elastic_array::ElasticArray1024;
use {DecoderError, UntrustedRlp, RlpStream};
pub trait Decodable: Sized {
fn decode(rlp: &UntrustedRlp) -> Result<Self, DecoderError>;
}
pub trait Encodable {
fn rlp_append(&self, s: &mut RlpStream);
fn rlp_bytes(&self) -> ElasticArray1024<u8> {
let mut s = RlpStream::new();
self.rlp_append(&mut s);
s.drain()
}
}
pub trait Compressible: Sized {
type DataType;
fn compress(&self, t: Self::DataType) -> ElasticArray1024<u8>;
fn decompress(&self, t: Self::DataType) -> ElasticArray1024<u8>;
}