Skip to main content

ToVoidCid

Trait ToVoidCid 

Source
pub trait ToVoidCid {
    // Required method
    fn to_void_cid(&self) -> Result<VoidCid>;

    // Provided method
    fn to_cid_string(&self) -> String { ... }
}
Expand description

Extension trait that adds .to_void_cid() and .to_cid_string() to typed CID newtypes from void-crypto (CommitCid, MetadataCid, ShardCid, etc.).

Replaces the verbose cid::from_bytes(x.as_bytes())? pattern.

Required Methods§

Source

fn to_void_cid(&self) -> Result<VoidCid>

Parse the serialized CID bytes into a VoidCid.

Provided Methods§

Source

fn to_cid_string(&self) -> String

Convert to a human-readable CID string (multibase-encoded).

Convenience for .to_void_cid()?.to_string() at display boundaries.

Implementors§