pub struct ExecutionResult {
pub success: bool,
pub return_data: Vec<u8>,
pub gas_used: u64,
pub gas_limit: u64,
pub exception: Option<RuntimeException>,
pub state_changes: Vec<StateChange>,
pub logs: Vec<LogEntry>,
pub stack_trace: Option<Vec<StackFrame>>,
pub metadata: ExecutionMetadata,
}Expand description
Runtime execution result
Fields§
§success: bool§return_data: Vec<u8>§gas_used: u64§gas_limit: u64§exception: Option<RuntimeException>§state_changes: Vec<StateChange>§logs: Vec<LogEntry>§stack_trace: Option<Vec<StackFrame>>§metadata: ExecutionMetadataImplementations§
§impl ExecutionResult
impl ExecutionResult
pub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Check if execution was successful
pub fn gas_efficiency(&self) -> f64
pub fn gas_efficiency(&self) -> f64
Get gas efficiency (percentage of gas limit used)
pub fn gas_remaining(&self) -> u64
pub fn gas_remaining(&self) -> u64
Get remaining gas
pub fn out_of_gas(&self) -> bool
pub fn out_of_gas(&self) -> bool
Check if execution ran out of gas
pub fn return_string(&self) -> Option<String>
pub fn return_string(&self) -> Option<String>
Get return data as string (if valid UTF-8)
pub fn return_hex(&self) -> String
pub fn return_hex(&self) -> String
Get return data as hex string
pub fn has_state_changes(&self) -> bool
pub fn has_state_changes(&self) -> bool
Check if there were any state changes
Trait Implementations§
Source§impl Clone for ExecutionResult
impl Clone for ExecutionResult
Source§fn clone(&self) -> ExecutionResult
fn clone(&self) -> ExecutionResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ExecutionResult
impl Debug for ExecutionResult
Source§impl<'de> Deserialize<'de> for ExecutionResult
impl<'de> Deserialize<'de> for ExecutionResult
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ExecutionResult
impl !RefUnwindSafe for ExecutionResult
impl !Send for ExecutionResult
impl !Sync for ExecutionResult
impl Unpin for ExecutionResult
impl !UnwindSafe for ExecutionResult
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more