[][src]Trait libipld::codec::Encode

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

Encode trait.

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

Required methods

pub fn encode<W>(&self, c: C, w: &mut W) -> Result<(), Error> where
    W: Write
[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<DagCborCodec> for [u8][src]

impl Encode<DagCborCodec> for i8[src]

impl<T> Encode<DagCborCodec> for Vec<T, Global> where
    T: Encode<DagCborCodec>, 
[src]

impl Encode<DagCborCodec> for i64[src]

impl Encode<DagCborCodec> for str[src]

impl Encode<DagCborCodec> for f64[src]

impl Encode<DagCborCodec> for u32[src]

impl Encode<DagCborCodec> for i32[src]

impl<T> Encode<DagCborCodec> for Option<T> where
    T: Encode<DagCborCodec>, 
[src]

impl Encode<DagCborCodec> for u8[src]

impl<T> Encode<DagCborCodec> for Arc<T> where
    T: Encode<DagCborCodec>, 
[src]

impl Encode<DagCborCodec> for String[src]

impl Encode<DagCborCodec> for bool[src]

impl Encode<DagCborCodec> for u16[src]

impl Encode<DagCborCodec> for i128[src]

impl Encode<DagCborCodec> for Box<[u8], Global>[src]

impl Encode<DagCborCodec> for u64[src]

impl<K, T> Encode<DagCborCodec> for BTreeMap<K, T> where
    T: 'static + Encode<DagCborCodec>,
    K: ToString
[src]

impl Encode<DagCborCodec> for i16[src]

impl Encode<DagCborCodec> for f32[src]

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

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

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

Loading content...

Implementors

impl Encode<IpldCodec> for Ipld[src]

impl Encode<RawCodec> for Ipld[src]

impl Encode<DagCborCodec> for Ipld[src]

impl Encode<DagCborCodec> for Cid<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>[src]

impl Encode<DagJsonCodec> for Ipld[src]

impl Encode<DagPbCodec> for Ipld[src]

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

Loading content...