Type Alias Sha256

Source
pub type Sha256 = GenericDigest<Sha256Marker>;
Expand description

A digest created by the Sha256 hashing algorithm.

Aliased Type§

struct Sha256 { /* 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]) -> Self

Trait Implementations

Source§

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

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

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) -> &Self::Target

Dereferences the value.
Source§

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

Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::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

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

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

Source§

fn from(bytes: [u8; 32]) -> Self

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<Self, Self::Err>

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

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

Source§

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

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> Ord for GenericDigest<T>

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> PartialEq for GenericDigest<T>

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> PartialOrd for GenericDigest<T>

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::Ok, S::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<Self, Self::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<Self, Self::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<Self, Self::Error>

Performs the conversion.
Source§

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

Source§

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

Source§

impl<T> StructuralPartialEq for GenericDigest<T>