Struct cid::Cid [−][src]
Representation of a CID.
Fields
version: Version
codec: Codec
hash: Vec<u8>
Methods
impl Cid[src]
impl Cidpub fn new(codec: Codec, version: Version, hash: &[u8]) -> Cid[src]
pub fn new(codec: Codec, version: Version, hash: &[u8]) -> CidCreate a new CID.
pub fn from<T: ToCid>(data: T) -> Result<Cid>[src]
pub fn from<T: ToCid>(data: T) -> Result<Cid>Create a new CID from raw data (binary or multibase encoded string)
pub fn new_from_prefix(prefix: &Prefix, data: &[u8]) -> Cid[src]
pub fn new_from_prefix(prefix: &Prefix, data: &[u8]) -> CidCreate a new CID from a prefix and some data.
pub fn to_string(&self) -> String[src]
pub fn to_string(&self) -> Stringpub fn to_bytes(&self) -> Vec<u8>[src]
pub fn to_bytes(&self) -> Vec<u8>pub fn prefix(&self) -> Prefix[src]
pub fn prefix(&self) -> PrefixTrait Implementations
impl PartialEq for Cid[src]
impl PartialEq for Cidfn eq(&self, other: &Cid) -> bool[src]
fn eq(&self, other: &Cid) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Cid) -> bool[src]
fn ne(&self, other: &Cid) -> boolThis method tests for !=.
impl Eq for Cid[src]
impl Eq for Cidimpl Clone for Cid[src]
impl Clone for Cidfn clone(&self) -> Cid[src]
fn clone(&self) -> CidReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)1.0.0
[src]Performs copy-assignment from source. Read more
impl Debug for Cid[src]
impl Debug for Cidfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Display for Cid[src]
impl Display for Cid