[][src]Trait forest_encoding::Cbor

pub trait Cbor: Serialize + DeserializeOwned {
    fn marshal_cbor(&self) -> Result<Vec<u8>, Error> { ... }
fn unmarshal_cbor(bz: &[u8]) -> Result<Self, Error> { ... }
fn cid(&self) -> Result<Cid, Error> { ... } }

Cbor utility functions for serializable objects

Provided methods

fn marshal_cbor(&self) -> Result<Vec<u8>, Error>

Marshalls cbor encodable object into cbor bytes

fn unmarshal_cbor(bz: &[u8]) -> Result<Self, Error>

Unmarshals cbor encoded bytes to object

fn cid(&self) -> Result<Cid, Error>

Returns the content identifier of the raw block of data Default is Blake2b256 hash

Loading content...

Implementors

Loading content...