pub struct Hash<const BYTES: usize>(/* private fields */);Expand description
data that is a cryptographic Hash of BYTES long.
Possible values with Cardano are 32 bytes long (block hash or transaction hash). Or 28 bytes long (as used in addresses)
Implementations§
Trait Implementations§
Source§impl<const BYTES: usize> AsPlutus for Hash<BYTES>
impl<const BYTES: usize> AsPlutus for Hash<BYTES>
fn from_plutus(data: PlutusData) -> Result<Self, DecodeError>
fn to_plutus(self) -> PlutusData
fn from_plutus_bytes(bytes: &[u8]) -> Result<Self, DecodeError>
fn to_plutus_bytes(self) -> Vec<u8> ⓘ
fn vec_from_plutus(data: PlutusData) -> Result<Vec<Self>, DecodeError>
fn vec_to_plutus(value: Vec<Self>) -> PlutusData
fn array_from_plutus<const N: usize>( data: PlutusData, ) -> Result<[Self; N], DecodeError>
fn array_to_plutus<const N: usize>(value: [Self; N]) -> PlutusData
Source§impl<'de, const BYTES: usize> Deserialize<'de> for Hash<BYTES>
impl<'de, const BYTES: usize> Deserialize<'de> for Hash<BYTES>
Source§fn deserialize<D>(
deserializer: D,
) -> Result<Hash<BYTES>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Hash<BYTES>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<const BYTES: usize> Ord for Hash<BYTES>
impl<const BYTES: usize> Ord for Hash<BYTES>
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<const BYTES: usize> PartialOrd for Hash<BYTES>
impl<const BYTES: usize> PartialOrd for Hash<BYTES>
Source§impl<const BYTES: usize> Serialize for Hash<BYTES>
impl<const BYTES: usize> Serialize for Hash<BYTES>
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
impl<const BYTES: usize> Copy for Hash<BYTES>
impl<const BYTES: usize> Eq for Hash<BYTES>
impl<const BYTES: usize> StructuralPartialEq for Hash<BYTES>
Auto Trait Implementations§
impl<const BYTES: usize> Freeze for Hash<BYTES>
impl<const BYTES: usize> RefUnwindSafe for Hash<BYTES>
impl<const BYTES: usize> Send for Hash<BYTES>
impl<const BYTES: usize> Sync for Hash<BYTES>
impl<const BYTES: usize> Unpin for Hash<BYTES>
impl<const BYTES: usize> UnwindSafe for Hash<BYTES>
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> ToHex for T
impl<T> ToHex for T
Source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self into the result. Lower case
letters are used (e.g. f9b4ca)Source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self into the result. Upper case
letters are used (e.g. F9B4CA)