Decode all instructions in the visitor's bytecode stream. The associated visitor method is invoked after each instruction is decoded.
(visitor: &mut V)
| 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. |