Struct ssvm_evmc_sys::evmc_result [−][src]
#[repr(C)]pub struct evmc_result {
pub status_code: evmc_status_code,
pub gas_left: i64,
pub output_data: *const u8,
pub output_size: usize,
pub release: evmc_release_result_fn,
pub create_address: evmc_address,
pub padding: [u8; 4],
}
Expand description
The EVM code execution result.
Fields
status_code: evmc_status_code
The execution status code.
gas_left: i64
The amount of gas left after the execution.
If evmc_result::code is not ::EVMC_SUCCESS nor ::EVMC_REVERT the value MUST be 0.
output_data: *const u8
The reference to output data.
The output contains data coming from RETURN opcode (iff evmc_result::code field is ::EVMC_SUCCESS) or from REVERT opcode.
The memory containing the output data is owned by EVM and has to be freed with evmc_result::release().
This MAY be NULL.
output_size: usize
The size of the output data.
If output_data is NULL this MUST be 0.
release: evmc_release_result_fn
The method releasing all resources associated with the result object.
This method (function pointer) is optional (MAY be NULL) and MAY be set by the VM implementation. If set it MUST be called by the user once to release memory and other resources associated with the result object. Once the resources are released the result object MUST NOT be used again.
The suggested code pattern for releasing execution results: @code struct evmc_result result = …; if (result.release) result.release(&result); @endcode
@note It works similarly to C++ virtual destructor. Attaching the release function to the result itself allows VM composition.
create_address: evmc_address
The address of the contract created by create instructions.
This field has valid value only if:
- it is a result of the Host method evmc_host_interface::call
- and the result describes successful contract creation (evmc_result::status_code is ::EVMC_SUCCESS). In all other cases the address MUST be null bytes.
padding: [u8; 4]
Reserved data that MAY be used by a evmc_result object creator.
This reserved 4 bytes together with 20 bytes from create_address form 24 bytes of memory called “optional data” within evmc_result struct to be optionally used by the evmc_result object creator.
@see evmc_result_optional_data, evmc_get_optional_data().
Also extends the size of the evmc_result to 64 bytes (full cache line).
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for evmc_result
impl !Send for evmc_result
impl !Sync for evmc_result
impl Unpin for evmc_result
impl UnwindSafe for evmc_result
Blanket Implementations
Mutably borrows from an owned value. Read more