[][src]Trait libipld_core::codec::Encode

pub trait Encode<C: Codec> {
    fn encode<W: Write>(&self, c: C, w: &mut W) -> Result<()>;
}

Encode trait.

This trait is generic over a codec, so that different codecs can be implemented for the same type.

Required methods

fn encode<W: Write>(&self, c: C, w: &mut W) -> Result<()>

Encodes into a impl Write.

It takes a specific codec as parameter, so that the Encode can be generic over an enum that contains multiple codecs.

Loading content...

Implementations on Foreign Types

impl Encode<RawCodec> for [u8][src]

impl Encode<RawCodec> for Box<[u8]>[src]

impl Encode<RawCodec> for Vec<u8>[src]

Loading content...

Implementors

impl Encode<RawCodec> for Ipld[src]

Loading content...