pub enum HashAlgorithm {
Sha256,
}Expand description
Hash algorithm used by an IntegrityHash pin on #import. Only
Sha256 is wired in v3++ b-2; the enum exists so future agents can
add Sha512 / Blake3 (or SRI multi-algo) without an AST shape
change.
Variants§
Sha256
Implementations§
Source§impl HashAlgorithm
impl HashAlgorithm
Sourcepub fn as_str(&self) -> &'static str
pub fn as_str(&self) -> &'static str
Canonical lowercase identifier as it appears in source
(sha256:"..."). Lookups in the parser / analyzer compare
against this so the casing is fixed in one place.
Sourcepub fn from_ident(name: &str) -> Option<Self>
pub fn from_ident(name: &str) -> Option<Self>
Reverse of HashAlgorithm::as_str. Returns None for unknown
names so the caller can emit a position-aware parse / analyzer
diagnostic.
Trait Implementations§
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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for HashAlgorithm
Source§impl Debug for HashAlgorithm
impl Debug for HashAlgorithm
impl Eq for HashAlgorithm
Source§impl Hash for HashAlgorithm
impl Hash for HashAlgorithm
Source§impl PartialEq for HashAlgorithm
impl PartialEq for HashAlgorithm
Source§fn eq(&self, other: &HashAlgorithm) -> bool
fn eq(&self, other: &HashAlgorithm) -> bool
Tests for
self and other values to be equal, and is used by ==.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