pub struct IntegrityHash {
pub algorithm: Option<HashAlgorithm>,
pub algorithm_text: String,
pub hex: String,
pub range: TokenRange,
}Expand description
Inline integrity pin on a #import directive. The source form is
<algorithm>:"<hex>" (e.g. sha256:"abc..."); the parser does not
validate the hex string itself — that work happens in the analyzer
so the diagnostic carries a real source span. The algorithm name
is preserved verbatim alongside the parsed HashAlgorithm enum
so the analyzer can render the offending identifier when it does
not match any known algorithm.
Fields§
§algorithm: Option<HashAlgorithm>Parsed algorithm. None when the source identifier did not
match any known algorithm — the analyzer surfaces the typo /
unsupported-algo diagnostic before the loader is consulted.
algorithm_text: StringVerbatim source identifier (sha256, sha512, …). Kept
alongside Self::algorithm so error messages can echo the
exact spelling the author used.
hex: String§range: TokenRangeFull source range covering <algorithm>:"<hex>" so analyzer
diagnostics (unknown algorithm, hex length mismatch, …) can
point at the right span.
Trait Implementations§
Source§impl Clone for IntegrityHash
impl Clone for IntegrityHash
Source§fn clone(&self) -> IntegrityHash
fn clone(&self) -> IntegrityHash
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for IntegrityHash
impl Debug for IntegrityHash
impl Eq for IntegrityHash
Source§impl PartialEq for IntegrityHash
impl PartialEq for IntegrityHash
Source§fn eq(&self, other: &IntegrityHash) -> bool
fn eq(&self, other: &IntegrityHash) -> bool
self and other values to be equal, and is used by ==.