pub enum HashAlgorithm {
Blake3,
}Expand description
Enumeration of supported hash algorithms
Variants§
Blake3
Implementations§
Source§impl HashAlgorithm
impl HashAlgorithm
Sourcepub fn identifier(&self) -> u8
pub fn identifier(&self) -> u8
Get the 1-byte identifier for this algorithm
Sourcepub fn output_length(&self) -> usize
pub fn output_length(&self) -> usize
Get the output length for this algorithm (excluding identifier)
Sourcepub fn from_identifier(id: u8) -> Result<Self, CryptoError>
pub fn from_identifier(id: u8) -> Result<Self, CryptoError>
Parse algorithm from 1-byte identifier
Trait Implementations§
Source§impl BorshDeserialize for HashAlgorithm
impl BorshDeserialize for HashAlgorithm
fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>
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 HashAlgorithm
impl BorshSerialize for HashAlgorithm
Source§impl Clone for HashAlgorithm
impl Clone for HashAlgorithm
Source§fn clone(&self) -> HashAlgorithm
fn clone(&self) -> HashAlgorithm
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 HashAlgorithm
impl Debug for HashAlgorithm
Source§impl<'de> Deserialize<'de> for HashAlgorithm
impl<'de> Deserialize<'de> for HashAlgorithm
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 Display for HashAlgorithm
impl Display for HashAlgorithm
Source§impl EnumExt for HashAlgorithm
impl EnumExt for HashAlgorithm
Source§impl Hash for HashAlgorithm
impl Hash for HashAlgorithm
Source§impl Ord for HashAlgorithm
impl Ord for HashAlgorithm
Source§fn cmp(&self, other: &HashAlgorithm) -> Ordering
fn cmp(&self, other: &HashAlgorithm) -> 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 HashAlgorithm
impl PartialEq for HashAlgorithm
Source§impl PartialOrd for HashAlgorithm
impl PartialOrd for HashAlgorithm
Source§impl Serialize for HashAlgorithm
impl Serialize for HashAlgorithm
impl Copy for HashAlgorithm
impl Eq for HashAlgorithm
impl StructuralPartialEq for HashAlgorithm
Auto Trait Implementations§
impl Freeze for HashAlgorithm
impl RefUnwindSafe for HashAlgorithm
impl Send for HashAlgorithm
impl Sync for HashAlgorithm
impl Unpin for HashAlgorithm
impl UnsafeUnpin for HashAlgorithm
impl UnwindSafe for HashAlgorithm
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