[]Trait ipld_block_builder::codec::Codec

pub trait Codec {
    type Error: 'static + Error + Send;

    const CODE: Codec;
    fn encode<T>(obj: &T) -> Result<Box<[u8]>, Self::Error>
    where
        T: Encode<Self> + ?Sized
, { ... }
fn decode<T>(bytes: &[u8]) -> Result<T, Self::Error>
    where
        T: Decode<Self>
, { ... } }

Codec trait.

Associated Types

type Error: 'static + Error + Send

Error type.

Loading content...

Associated Constants

const CODE: Codec

Codec code.

Loading content...

Provided methods

fn encode<T>(obj: &T) -> Result<Box<[u8]>, Self::Error> where
    T: Encode<Self> + ?Sized

fn decode<T>(bytes: &[u8]) -> Result<T, Self::Error> where
    T: Decode<Self>, 

Loading content...

Implementors

impl Codec for DagCbor

type Error = Error

impl Codec for Raw

type Error = RawError

Loading content...