MCPcopy Create free account
hub / github.com/argumentcomputer/ix / hash_syntax_preresolved

Function hash_syntax_preresolved

crates/common/src/env.rs:653–672  ·  view source on GitHub ↗
(
  sp: &SyntaxPreresolved,
  hasher: &mut blake3::Hasher,
)

Source from the content-addressed store, hash-verified

651 hasher.update(&stop.to_le_bytes());
652 hasher.update(&[u8::from(*canonical)]);
653 },
654 SourceInfo::None => {
655 hasher.update(&[2]);
656 },
657 }
658}
659
660/// Pre-resolved reference attached to a syntax identifier.
661#[derive(Debug, PartialEq, Eq, Clone, Hash)]
662pub enum SyntaxPreresolved {
663 /// A pre-resolved namespace reference.
664 Namespace(Name),
665 /// A pre-resolved declaration reference with alias strings.
666 Decl(Name, Vec<String>),
667}
668
669fn hash_syntax_preresolved(
670 sp: &SyntaxPreresolved,
671 hasher: &mut blake3::Hasher,
672) {
673 hasher.update(&[MSPRE]);
674 match sp {
675 SyntaxPreresolved::Namespace(name) => {

Callers 1

hash_syntaxFunction · 0.85

Calls 2

as_bytesMethod · 0.80
get_hashMethod · 0.80

Tested by

no test coverage detected