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],
}

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::status_code is neither ::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

impl Clone for evmc_result[src]

impl Copy for evmc_result[src]

impl Debug for evmc_result[src]

impl Hash for evmc_result[src]

impl PartialEq<evmc_result> for evmc_result[src]

impl StructuralPartialEq for evmc_result[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.