Struct evmil::Bytecode

source ·
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§

Get access to the raw sequence of instructions.

Return the number of labels in the instruction sequence thus far.

Translate this sequence of bytecode instructions into a sequence of raw bytes. This can still fail in a number of ways. For example, the target for a PUSHL does not match any known JUMPEST label; Or, the stack size is exceeded, etc.

Trait Implementations§

Translate a sequence of IL statements into EVM bytecode, or fail with an error.

The type returned in the event of a conversion error.
Performs the conversion.

Translate a sequence of IL statements into EVM bytecode, or fail with an error.

The type returned in the event of a conversion error.
Performs the conversion.

Try and translate a bytecode sequence into byte sequence. This can fail for a number of reasons (e.g. dangling branches, stack depth exceeded, etc).

The type returned in the event of a conversion error.
Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.