#[non_exhaustive]pub enum HashAlg {
Sha2_256,
}Expand description
A hash algorithm usable for content identifiers.
sha2-256 is required by Section 4.2. Further algorithms are added as
variants rather than as a trait object, because the set is small, closed
at any given protocol version, and exhaustively matched.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Sha2_256
SHA-256, required by Section 4.2.
Implementations§
Source§impl HashAlg
impl HashAlg
Sourcepub fn id(self) -> &'static str
pub fn id(self) -> &'static str
The in-band identifier used in a CID.
§Example
use publet_core::HashAlg;
assert_eq!(HashAlg::Sha2_256.id(), "sha2-256");Trait Implementations§
impl Copy for HashAlg
impl Eq for HashAlg
impl StructuralPartialEq for HashAlg
Auto Trait Implementations§
impl Freeze for HashAlg
impl RefUnwindSafe for HashAlg
impl Send for HashAlg
impl Sync for HashAlg
impl Unpin for HashAlg
impl UnsafeUnpin for HashAlg
impl UnwindSafe for HashAlg
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