pub struct Decoder { /* private fields */ }
Available on crate feature
decode
only.Expand description
A Pulley bytecode decoder.
Does not materialize bytecode instructions, instead all decoding methods are
given an OpVisitor
implementation and the appropriate visitor methods are
called upon decoding an instruction. This minimizes the amount of times we
branch on the opcode, avoids constructing temporary storage, and plays well
with our variable-length instruction encoding.
Implementations§
Source§impl Decoder
impl Decoder
Source§impl Decoder
impl Decoder
Sourcepub fn decode_one<V>(
&mut self,
visitor: &mut V,
) -> Result<V::Return, <V::BytecodeStream as BytecodeStream>::Error>where
V: OpVisitor + ExtendedOpVisitor,
pub fn decode_one<V>(
&mut self,
visitor: &mut V,
) -> Result<V::Return, <V::BytecodeStream as BytecodeStream>::Error>where
V: OpVisitor + ExtendedOpVisitor,
Decode one instruction from the visitor’s bytestream.
Upon decoding, the visitor’s associated callback is invoked and the results returned.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Decoder
impl RefUnwindSafe for Decoder
impl Send for Decoder
impl Sync for Decoder
impl Unpin for Decoder
impl UnwindSafe for Decoder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more