[−][src]Struct forest_cid::Cid
Implementations
impl Cid
[src]
pub fn new(version: Version, codec: u64, hash: Multihash) -> Result<Self, Error>
[src]
Create a new CID.
pub fn new_v1(codec: u64, hash: Multihash) -> Self
[src]
Create a new CIDv1.
pub fn version(&self) -> Version
[src]
Returns the cid version.
pub fn codec(&self) -> u64
[src]
Returns the cid codec.
pub fn hash(&self) -> &Multihash
[src]
Returns the cid multihash.
pub fn read_bytes<R: Read>(reader: R) -> Result<Self, Error>
[src]
Reads the bytes from a byte stream.
pub fn to_bytes(&self) -> Vec<u8>
[src]
Returns the encoded bytes of the Cid
.
Trait Implementations
impl Clone for Cid
[src]
impl Copy for Cid
[src]
impl Debug for Cid
[src]
impl Default for Cid
[src]
impl<'de> Deserialize<'de> for Cid
[src]
pub fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl Display for Cid
[src]
impl Eq for Cid
[src]
impl From<Cid> for Prefix
[src]
impl From<CidJson> for Cid
[src]
impl FromStr for Cid
[src]
type Err = Error
The associated error which can be returned from parsing.
pub fn from_str(src: &str) -> Result<Self, Error>
[src]
impl Hash for Cid
[src]
pub fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for Cid
[src]
pub fn cmp(&self, other: &Cid) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<Cid> for Cid
[src]
impl PartialOrd<Cid> for Cid
[src]
pub fn partial_cmp(&self, other: &Cid) -> Option<Ordering>
[src]
pub fn lt(&self, other: &Cid) -> bool
[src]
pub fn le(&self, other: &Cid) -> bool
[src]
pub fn gt(&self, other: &Cid) -> bool
[src]
pub fn ge(&self, other: &Cid) -> bool
[src]
impl Serialize for Cid
[src]
impl StructuralEq for Cid
[src]
impl StructuralPartialEq for Cid
[src]
impl<'_> TryFrom<&'_ [u8]> for Cid
[src]
type Error = Error
The type returned in the event of a conversion error.
pub fn try_from(value: &[u8]) -> Result<Self, Self::Error>
[src]
impl<'_> TryFrom<&'_ str> for Cid
[src]
type Error = Error
The type returned in the event of a conversion error.
pub fn try_from(value: &str) -> Result<Self, Self::Error>
[src]
impl TryFrom<String> for Cid
[src]
type Error = Error
The type returned in the event of a conversion error.
pub fn try_from(value: String) -> Result<Self, Self::Error>
[src]
impl TryFrom<Vec<u8, Global>> for Cid
[src]
Auto Trait Implementations
impl RefUnwindSafe for Cid
impl Send for Cid
impl Sync for Cid
impl Unpin for Cid
impl UnwindSafe for Cid
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,