Type Alias Hash

Source
pub type Hash = GenericDigest<FuchsiaMerkleMarker>;
Expand description

A digest created by the Fuchsia Merkle Tree hashing algorithm. https://fuchsia.dev/fuchsia-src/concepts/packages/merkleroot

Aliased Type§

struct Hash { /* private fields */ }

Implementations

Source§

impl<T> GenericDigest<T>

Source

pub fn as_bytes(&self) -> &[u8]

Obtain a slice of the bytes representing the hash.

Source

pub const fn from_array(arr: [u8; 32]) -> GenericDigest<T>

Trait Implementations

Source§

impl<T> Clone for GenericDigest<T>
where T: Clone,

Source§

fn clone(&self) -> GenericDigest<T>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T> Debug for GenericDigest<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<T> Deref for GenericDigest<T>

Source§

type Target = [u8; 32]

The resulting type after dereferencing.
Source§

fn deref(&self) -> &<GenericDigest<T> as Deref>::Target

Dereferences the value.
Source§

impl<'de, T> Deserialize<'de> for GenericDigest<T>

Source§

fn deserialize<D>( deserializer: D, ) -> Result<GenericDigest<T>, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<T> Display for GenericDigest<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<T> From<[u8; 32]> for GenericDigest<T>

Source§

fn from(bytes: [u8; 32]) -> GenericDigest<T>

Converts to this type from the input type.
Source§

impl<T> FromStr for GenericDigest<T>

Source§

type Err = ParseHashError

The associated error which can be returned from parsing.
Source§

fn from_str( s: &str, ) -> Result<GenericDigest<T>, <GenericDigest<T> as FromStr>::Err>

Parses a string s to return a value of this type. Read more
Source§

impl<T> Hash for GenericDigest<T>
where T: Hash,

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<T> Ord for GenericDigest<T>
where T: Ord,

Source§

fn cmp(&self, other: &GenericDigest<T>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<T> PartialEq for GenericDigest<T>
where T: PartialEq,

Source§

fn eq(&self, other: &GenericDigest<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T> PartialOrd for GenericDigest<T>
where T: PartialOrd,

Source§

fn partial_cmp(&self, other: &GenericDigest<T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<T> Serialize for GenericDigest<T>

Source§

fn serialize<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<T> TryFrom<&[u8]> for GenericDigest<T>

Source§

type Error = TryFromSliceError

The type returned in the event of a conversion error.
Source§

fn try_from( bytes: &[u8], ) -> Result<GenericDigest<T>, <GenericDigest<T> as TryFrom<&[u8]>>::Error>

Performs the conversion.
Source§

impl<T> TryFrom<&str> for GenericDigest<T>

Source§

type Error = ParseHashError

The type returned in the event of a conversion error.
Source§

fn try_from( s: &str, ) -> Result<GenericDigest<T>, <GenericDigest<T> as TryFrom<&str>>::Error>

Performs the conversion.
Source§

impl<T> TryFrom<String> for GenericDigest<T>

Source§

type Error = ParseHashError

The type returned in the event of a conversion error.
Source§

fn try_from( s: String, ) -> Result<GenericDigest<T>, <GenericDigest<T> as TryFrom<String>>::Error>

Performs the conversion.
Source§

impl<T> Copy for GenericDigest<T>
where T: Copy,

Source§

impl<T> Eq for GenericDigest<T>
where T: Eq,

Source§

impl<T> StructuralPartialEq for GenericDigest<T>