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

Method as_slice

crates/ixon/src/lazy.rs:70–75  ·  view source on GitHub ↗

View the bytes as a `&[u8]`. Zero-copy for both variants: `Heap` derefs the `Arc<[u8]>`; `Mmap` slices the mapping.

(&self)

Source from the content-addressed store, hash-verified

68impl BytesSource {
69 /// View the bytes as a `&[u8]`. Zero-copy for both variants:
70 /// `Heap` derefs the `Arc<[u8]>`; `Mmap` slices the mapping.
71 pub fn as_slice(&self) -> &[u8] {
72 match self {
73 BytesSource::Heap(arc) => arc,
74 BytesSource::Mmap { mmap, offset, len } => &mmap[*offset..*offset + *len],
75 }
76 }
77}
78

Callers 15

mainFunction · 0.80
run_shard_planFunction · 0.80
readMethod · 0.80
decompile_recursorFunction · 0.80
decompile_inductiveFunction · 0.80
ixon_egressFunction · 0.80
collect_mut_const_exprsFunction · 0.80
compile_single_defFunction · 0.80
compile_const_innerFunction · 0.80

Calls

no outgoing calls