pub struct Hash<T>(/* private fields */);Expand description
Output of the SHA256t hash function.
Implementations§
Source§impl<T> Hash<T>
impl<T> Hash<T>
Sourcepub const fn from_bytes_ref(bytes: &[u8; 32]) -> &Self
pub const fn from_bytes_ref(bytes: &[u8; 32]) -> &Self
Zero cost conversion between a fixed length byte array shared reference and a shared reference to this Hash type.
Sourcepub fn from_bytes_mut(bytes: &mut [u8; 32]) -> &mut Self
pub fn from_bytes_mut(bytes: &mut [u8; 32]) -> &mut Self
Zero cost conversion between a fixed length byte array exclusive reference and an exclusive reference to this Hash type.
Source§impl<T> Hash<T>where
T: Tag,
impl<T> Hash<T>where
T: Tag,
Sourcepub const fn from_byte_array(bytes: [u8; 32]) -> Self
pub const fn from_byte_array(bytes: [u8; 32]) -> Self
Constructs a new hash from the underlying byte array.
Sourcepub fn from_engine(e: HashEngine<T>) -> Self
pub fn from_engine(e: HashEngine<T>) -> Self
Produces a hash from the current state of a given engine.
Sourcepub fn engine() -> HashEngine<T> ⓘ
pub fn engine() -> HashEngine<T> ⓘ
Constructs a new engine.
Sourcepub fn hash_byte_chunks<B, I>(byte_slices: I) -> Self
pub fn hash_byte_chunks<B, I>(byte_slices: I) -> Self
Hashes all the byte slices retrieved from the iterator together.
Sourcepub const fn to_byte_array(self) -> [u8; 32]
pub const fn to_byte_array(self) -> [u8; 32]
Returns the underlying byte array.
Sourcepub const fn as_byte_array(&self) -> &[u8; 32]
pub const fn as_byte_array(&self) -> &[u8; 32]
Returns a reference to the underlying byte array.
Trait Implementations§
Source§impl<'de, T: Tag> Deserialize<'de> for Hash<T>
impl<'de, T: Tag> Deserialize<'de> for Hash<T>
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Hash<T>, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Hash<T>, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T: Tag> Hash for Hash<T>
impl<T: Tag> Hash for Hash<T>
Source§const DISPLAY_BACKWARD: bool = false
const DISPLAY_BACKWARD: bool = false
Flag indicating whether user-visible serializations of this hash should be backward. Read more
Source§fn from_byte_array(bytes: Self::Bytes) -> Self
fn from_byte_array(bytes: Self::Bytes) -> Self
Constructs a new hash from the underlying byte array.
Source§fn to_byte_array(self) -> Self::Bytes
fn to_byte_array(self) -> Self::Bytes
Returns the underlying byte array.
Source§fn as_byte_array(&self) -> &Self::Bytes
fn as_byte_array(&self) -> &Self::Bytes
Returns a reference to the underlying byte array.
Source§impl<T: Tag> Ord for Hash<T>
impl<T: Tag> Ord for Hash<T>
Source§impl<T: Tag> PartialOrd for Hash<T>
impl<T: Tag> PartialOrd for Hash<T>
impl<T: Tag> Copy for Hash<T>
impl<T: Tag> Eq for Hash<T>
Auto Trait Implementations§
impl<T> Freeze for Hash<T>
impl<T> RefUnwindSafe for Hash<T>where
T: RefUnwindSafe,
impl<T> Send for Hash<T>where
T: Send,
impl<T> Sync for Hash<T>where
T: Sync,
impl<T> Unpin for Hash<T>where
T: Unpin,
impl<T> UnwindSafe for Hash<T>where
T: UnwindSafe,
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