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

Method decode_all

pulley/src/decode.rs:520–532  ·  view source on GitHub ↗

Decode all instructions in the visitor's bytecode stream. The associated visitor method is invoked after each instruction is decoded.

(visitor: &mut V)

Source from the content-addressed store, hash-verified

518 /// The associated visitor method is invoked after each instruction is
519 /// decoded.
520 pub fn decode_all<'a, V>(visitor: &mut V) -> Result<Vec<V::Return>>
521 where
522 V: OpVisitor<BytecodeStream = SafeBytecodeStream<'a>> + ExtendedOpVisitor,
523 {
524 let mut decoder = Decoder::new();
525 let mut results = Vec::new();
526
527 while !visitor.bytecode().as_slice().is_empty() {
528 results.push(decoder.decode_one(visitor)?);
529 }
530
531 Ok(results)
532 }
533}
534
535/// An `OpVisitor` combinator to sequence one visitor and then another.

Callers

nothing calls this directly

Calls 6

OkFunction · 0.85
newFunction · 0.50
is_emptyMethod · 0.45
as_sliceMethod · 0.45
bytecodeMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected