Trait libipld::prelude::Codec

source ·
pub trait Codec: Copy + Unpin + Send + Sync + 'static + Sized + TryFrom<u64, Error = UnsupportedCodec> + Into<u64> {
    fn encode<T>(&self, obj: &T) -> Result<Vec<u8, Global>, Error>
    where
        T: Encode<Self> + ?Sized
, { ... } fn decode<T>(&self, bytes: &[u8]) -> Result<T, Error>
    where
        T: Decode<Self>
, { ... } fn references<T, E>(&self, bytes: &[u8], set: &mut E) -> Result<(), Error>
    where
        T: References<Self>,
        E: Extend<Cid<64>>
, { ... } }
Expand description

Codec trait.

Provided Methods§

Encodes an encodable type.

Decodes a decodable type.

Scrapes the references.

Implementations on Foreign Types§

Implementors§