pub struct Bytecode { /* private fields */ }
Expand description
Represents a sequence of zero or more bytecodes which can be turned, for example, into a hex string. Likewise, they can be decompiled or further optimised.
Implementations§
source§impl Bytecode
impl Bytecode
pub fn new() -> Self
pub fn push(&mut self, insn: Instruction)
sourcepub fn instructions(&self) -> &[Instruction]
pub fn instructions(&self) -> &[Instruction]
Get access to the raw sequence of instructions.
sourcepub fn fresh_label(&mut self) -> usize
pub fn fresh_label(&mut self) -> usize
Return the number of labels in the instruction sequence thus far.
Trait Implementations§
source§impl<const N: usize> TryFrom<&[Term; N]> for Bytecode
impl<const N: usize> TryFrom<&[Term; N]> for Bytecode
Translate a sequence of IL statements into EVM bytecode, or fail with an error.
source§impl TryFrom<&[Term]> for Bytecode
impl TryFrom<&[Term]> for Bytecode
Translate a sequence of IL statements into EVM bytecode, or fail with an error.