Trait libipld_core::codec::Codec[][src]

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

Codec trait.

Provided methods

fn encode<T: Encode<Self> + ?Sized>(&self, obj: &T) -> Result<Vec<u8>>[src]

Encodes an encodable type.

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

Decodes a decodable type.

fn references<T: References<Self>, E: Extend<Cid>>(
    &self,
    bytes: &[u8],
    set: &mut E
) -> Result<()>
[src]

Scrapes the references.

Loading content...

Implementors

Loading content...