MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / decode

Function decode

pulley/src/profile.rs:196–204  ·  view source on GitHub ↗

Decodes a `*.data` file presented in its entirety as `bytes` into a sequence of `Event`s.

(mut bytes: &[u8])

Source from the content-addressed store, hash-verified

194/// Decodes a `*.data` file presented in its entirety as `bytes` into a sequence
195/// of `Event`s.
196pub fn decode(mut bytes: &[u8]) -> impl Iterator<Item = Result<Event<'_>>> + use<'_> {
197 std::iter::from_fn(move || {
198 if bytes.is_empty() {
199 None
200 } else {
201 Some(decode_one(&mut bytes))
202 }
203 })
204}
205
206fn decode_one<'a>(bytes: &mut &'a [u8]) -> Result<Event<'a>> {
207 match bytes.split_first().unwrap() {

Callers 13

try_fromMethod · 0.85
br_table32Method · 0.85
disas_br_table32Method · 0.85
decodeMethod · 0.85
extendedFunction · 0.85
dispatchFunction · 0.85
run_extendedFunction · 0.85
mainFunction · 0.85
lookup_or_computeMethod · 0.85
getMethod · 0.85
swapMethod · 0.85
inline_trace_infoMethod · 0.85

Calls 2

decode_oneFunction · 0.85
is_emptyMethod · 0.45

Tested by

no test coverage detected