pub trait Codec {
type Error: Error + Into<BlockError>;
const VERSION: Version;
const CODEC: Codec;
// Required methods
fn encode(ipld: &Ipld) -> Result<Box<[u8]>, Self::Error>;
fn decode(data: &[u8]) -> Result<Ipld, Self::Error>;
}Expand description
Codec trait.
Required Associated Constants§
Required Associated Types§
Sourcetype Error: Error + Into<BlockError>
type Error: Error + Into<BlockError>
Error type.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.