Struct near_workspaces::result::ExecutionResult
source · #[non_exhaustive]pub struct ExecutionResult<T> {
pub total_gas_burnt: Gas,
/* private fields */
}Expand description
The result after evaluating the status of an execution. This can be ExecutionSuccess
for successful executions or a ExecutionFailure for failed ones.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.total_gas_burnt: GasTotal gas burnt by the execution
Implementations§
source§impl ExecutionResult<Value>
impl ExecutionResult<Value>
sourcepub fn json<T: DeserializeOwned>(&self) -> Result<T>
pub fn json<T: DeserializeOwned>(&self) -> Result<T>
Deserialize an instance of type T from bytes of JSON text sourced from the
execution result of this call. This conversion can fail if the structure of
the internal state does not meet up with serde::de::DeserializeOwned’s
requirements.
sourcepub fn borsh<T: BorshDeserialize>(&self) -> Result<T>
pub fn borsh<T: BorshDeserialize>(&self) -> Result<T>
Deserialize an instance of type T from bytes sourced from the execution
result. This conversion can fail if the structure of the internal state does
not meet up with borsh::BorshDeserialize’s requirements.
sourcepub fn raw_bytes(&self) -> Result<Vec<u8>>
pub fn raw_bytes(&self) -> Result<Vec<u8>>
Grab the underlying raw bytes returned from calling into a contract’s function.
If we want to deserialize these bytes into a rust datatype, use ExecutionResult::json
or ExecutionResult::borsh instead.
source§impl<T> ExecutionResult<T>
impl<T> ExecutionResult<T>
sourcepub fn outcome(&self) -> &ExecutionOutcome
pub fn outcome(&self) -> &ExecutionOutcome
Returns just the transaction outcome.
sourcepub fn outcomes(&self) -> Vec<&ExecutionOutcome>
pub fn outcomes(&self) -> Vec<&ExecutionOutcome>
Grab all outcomes after the execution of the transaction. This includes outcomes from the transaction and all the receipts it generated.
sourcepub fn receipt_outcomes(&self) -> &[ExecutionOutcome]
pub fn receipt_outcomes(&self) -> &[ExecutionOutcome]
Grab all outcomes after the execution of the transaction. This includes outcomes only from receipts generated by this transaction.
sourcepub fn failures(&self) -> Vec<&ExecutionOutcome>
pub fn failures(&self) -> Vec<&ExecutionOutcome>
Grab all outcomes that did not succeed the execution of this transaction. This will also include the failures from receipts as well.
sourcepub fn receipt_failures(&self) -> Vec<&ExecutionOutcome>
pub fn receipt_failures(&self) -> Vec<&ExecutionOutcome>
Just like failures, grab only failed receipt outcomes.
Trait Implementations§
source§impl<T: Clone> Clone for ExecutionResult<T>
impl<T: Clone> Clone for ExecutionResult<T>
source§fn clone(&self) -> ExecutionResult<T>
fn clone(&self) -> ExecutionResult<T>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl<T: Debug> Debug for ExecutionResult<T>
impl<T: Debug> Debug for ExecutionResult<T>
source§impl From<ExecutionResult<TxExecutionError>> for Error
impl From<ExecutionResult<TxExecutionError>> for Error
source§fn from(error: ExecutionFailure) -> Self
fn from(error: ExecutionFailure) -> Self
source§impl<T: PartialEq> PartialEq<ExecutionResult<T>> for ExecutionResult<T>
impl<T: PartialEq> PartialEq<ExecutionResult<T>> for ExecutionResult<T>
source§fn eq(&self, other: &ExecutionResult<T>) -> bool
fn eq(&self, other: &ExecutionResult<T>) -> bool
impl<T: Eq> Eq for ExecutionResult<T>
impl<T> StructuralEq for ExecutionResult<T>
impl<T> StructuralPartialEq for ExecutionResult<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for ExecutionResult<T>where
T: RefUnwindSafe,
impl<T> Send for ExecutionResult<T>where
T: Send,
impl<T> Sync for ExecutionResult<T>where
T: Sync,
impl<T> Unpin for ExecutionResult<T>where
T: Unpin,
impl<T> UnwindSafe for ExecutionResult<T>where
T: UnwindSafe,
Blanket Implementations§
§impl<T> AsFail for Twhere
T: Fail,
impl<T> AsFail for Twhere
T: Fail,
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<E> Fail for Ewhere
E: 'static + Error + Send + Sync,
impl<E> Fail for Ewhere
E: 'static + Error + Send + Sync,
§fn cause(&self) -> Option<&(dyn Fail + 'static)>
fn cause(&self) -> Option<&(dyn Fail + 'static)>
§fn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
Backtrace carried by this failure, if it
carries one. Read more