pub struct Disassembler { /* private fields */ }Expand description
Stateless helper that decodes Neo VM bytecode into structured instructions.
The disassembler maintains no state between calls; configuration only controls how unknown opcode bytes are handled.
Implementations§
Source§impl Disassembler
impl Disassembler
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a disassembler that permits unknown opcodes.
Equivalent to Disassembler::with_unknown_handling(UnknownHandling::Permit).
Sourcepub fn with_unknown_handling(unknown: UnknownHandling) -> Self
pub fn with_unknown_handling(unknown: UnknownHandling) -> Self
Create a disassembler configured with the desired unknown-opcode policy.
See UnknownHandling for the available strategies.
Sourcepub fn disassemble(&self, bytecode: &[u8]) -> Result<Vec<Instruction>>
pub fn disassemble(&self, bytecode: &[u8]) -> Result<Vec<Instruction>>
Disassemble an entire bytecode buffer.
§Errors
Returns an error if the bytecode stream is truncated, contains an operand
that exceeds the supported maximum size, or contains an unknown opcode
while configured with UnknownHandling::Error.
Any non-fatal warnings are discarded; call Self::disassemble_with_warnings
to inspect them.
Sourcepub fn disassemble_with_warnings(
&self,
bytecode: &[u8],
) -> Result<DisassemblyOutput>
pub fn disassemble_with_warnings( &self, bytecode: &[u8], ) -> Result<DisassemblyOutput>
Disassemble an entire bytecode buffer, returning any non-fatal warnings.
§Errors
Returns an error if the bytecode stream is truncated, contains an operand
that exceeds the supported maximum size, or contains an unknown opcode
while configured with UnknownHandling::Error.
Trait Implementations§
Source§impl Clone for Disassembler
impl Clone for Disassembler
Source§fn clone(&self) -> Disassembler
fn clone(&self) -> Disassembler
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more