pub struct CryptoHash(pub [u8; 32]);Expand description
A type that represents a hash of the data.
This type is copy of the crate::CryptoHash as part of the decoupling initiative
Tuple Fields§
§0: [u8; 32]Implementations§
Source§impl CryptoHash
impl CryptoHash
pub fn hash(bytes: &[u8]) -> CryptoHash
Trait Implementations§
Source§impl BorshDeserialize for CryptoHash
impl BorshDeserialize for CryptoHash
fn deserialize_reader<__R>(reader: &mut __R) -> Result<CryptoHash, Error>where
__R: Read,
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl BorshSerialize for CryptoHash
impl BorshSerialize for CryptoHash
Source§impl Clone for CryptoHash
impl Clone for CryptoHash
Source§fn clone(&self) -> CryptoHash
fn clone(&self) -> CryptoHash
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CryptoHash
impl Debug for CryptoHash
Source§impl Default for CryptoHash
impl Default for CryptoHash
Source§fn default() -> CryptoHash
fn default() -> CryptoHash
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for CryptoHash
impl<'de> Deserialize<'de> for CryptoHash
Source§fn deserialize<D>(
deserializer: D,
) -> Result<CryptoHash, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<CryptoHash, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for CryptoHash
impl Display for CryptoHash
Source§impl From<CryptoHash> for CryptoHash
impl From<CryptoHash> for CryptoHash
Source§fn from(hash: CryptoHash) -> CryptoHash
fn from(hash: CryptoHash) -> CryptoHash
Converts to this type from the input type.
Source§impl FromStr for CryptoHash
impl FromStr for CryptoHash
Source§type Err = DataConversionError
type Err = DataConversionError
The associated error which can be returned from parsing.
Source§fn from_str(s: &str) -> Result<CryptoHash, <CryptoHash as FromStr>::Err>
fn from_str(s: &str) -> Result<CryptoHash, <CryptoHash as FromStr>::Err>
Parses a string
s to return a value of this type. Read moreSource§impl Hash for CryptoHash
impl Hash for CryptoHash
Source§impl Ord for CryptoHash
impl Ord for CryptoHash
Source§fn cmp(&self, other: &CryptoHash) -> Ordering
fn cmp(&self, other: &CryptoHash) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for CryptoHash
impl PartialEq for CryptoHash
Source§impl PartialOrd for CryptoHash
impl PartialOrd for CryptoHash
Source§impl Serialize for CryptoHash
impl Serialize for CryptoHash
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
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 TryFrom<&[u8]> for CryptoHash
impl TryFrom<&[u8]> for CryptoHash
Source§type Error = DataConversionError
type Error = DataConversionError
The type returned in the event of a conversion error.
Source§fn try_from(
bytes: &[u8],
) -> Result<CryptoHash, <CryptoHash as TryFrom<&[u8]>>::Error>
fn try_from( bytes: &[u8], ) -> Result<CryptoHash, <CryptoHash as TryFrom<&[u8]>>::Error>
Performs the conversion.
Source§impl TryFrom<CryptoHash> for CryptoHash
impl TryFrom<CryptoHash> for CryptoHash
Source§type Error = DataConversionError
type Error = DataConversionError
The type returned in the event of a conversion error.
Source§fn try_from(
value: CryptoHash,
) -> Result<CryptoHash, <CryptoHash as TryFrom<CryptoHash>>::Error>
fn try_from( value: CryptoHash, ) -> Result<CryptoHash, <CryptoHash as TryFrom<CryptoHash>>::Error>
Performs the conversion.
impl Copy for CryptoHash
impl Eq for CryptoHash
impl StructuralPartialEq for CryptoHash
Auto Trait Implementations§
impl Freeze for CryptoHash
impl RefUnwindSafe for CryptoHash
impl Send for CryptoHash
impl Sync for CryptoHash
impl Unpin for CryptoHash
impl UnwindSafe for CryptoHash
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.