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

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<()>[src]

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]

impl<C: Codec> Encode<C> for RawValue<C>[src]

impl<C: Codec, T> Encode<C> for Link<T> where
    Cid: Encode<C>, 
[src]

Loading content...