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

Function defn_constant

crates/ixon/src/lazy.rs:261–269  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

259 /// constants that are standalone or projections, this is the only
260 /// byte we ever read at enumeration time.
261 pub fn peek_variant(&self) -> Result<ConstVariantTag, String> {
262 let bytes = self.bytes.as_slice();
263 let head = *bytes
264 .first()
265 .ok_or_else(|| "LazyConstant::peek_variant: empty bytes".to_string())?;
266 let flag = head >> 4;
267 let large = head & 0b1000 != 0;
268 let small = head & 0b0111;
269 match flag {
270 Constant::FLAG_MUTS => Ok(ConstVariantTag::Muts),
271 Constant::FLAG => {
272 if large {

Callers 5

equality_by_bytesFunction · 0.85
mmap_slice_roundtripsFunction · 0.85

Calls 2

sortFunction · 0.85
varFunction · 0.50

Tested by 5

equality_by_bytesFunction · 0.68
mmap_slice_roundtripsFunction · 0.68