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

Method proj

crates/common/src/env.rs:944–951  ·  view source on GitHub ↗

Constructs a projection expression (type name, field index, struct expr).

(n: Name, i: Nat, e: Expr)

Source from the content-addressed store, hash-verified

942 };
943 Expr(Arc::new(ExprData::Lit(x, hasher.finalize())))
944 }
945
946 /// Constructs a metadata-annotated expression.
947 pub fn mdata(xs: Vec<(Name, DataValue)>, e: Expr) -> Self {
948 let mut hasher = blake3::Hasher::new();
949 hasher.update(&[EMDATA]);
950 hasher.update(&Nat::from(xs.len() as u64).to_le_bytes());
951 for (name, dv) in &xs {
952 hasher.update(name.get_hash().as_bytes());
953 hash_data_value(dv, &mut hasher);
954 }

Callers

nothing calls this directly

Calls 4

as_bytesMethod · 0.80
get_hashMethod · 0.80
finalizeMethod · 0.80
ExprClass · 0.70

Tested by

no test coverage detected