#[non_exhaustive]pub struct ExecutionResult<T> {
pub total_gas_burnt: NearGas,
pub value: T,
pub details: ExecutionDetails,
}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: NearGasTotal gas burnt by the execution
value: TValue returned from an execution. This is a base64 encoded str for a successful
execution or a TxExecutionError if a failed one.
details: ExecutionDetailsAdditional details related to 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) -> &ExecutionOutcomeWithIdView
pub fn outcome(&self) -> &ExecutionOutcomeWithIdView
Returns just the transaction outcome.
sourcepub fn outcomes(&self) -> Vec<&ExecutionOutcomeWithIdView>
pub fn outcomes(&self) -> Vec<&ExecutionOutcomeWithIdView>
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) -> &[ExecutionOutcomeWithIdView]
pub fn receipt_outcomes(&self) -> &[ExecutionOutcomeWithIdView]
Grab all outcomes after the execution of the transaction. This includes outcomes only from receipts generated by this transaction.
sourcepub fn failures(&self) -> Vec<&ExecutionOutcomeWithIdView>
pub fn failures(&self) -> Vec<&ExecutionOutcomeWithIdView>
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<&ExecutionOutcomeWithIdView>
pub fn receipt_failures(&self) -> Vec<&ExecutionOutcomeWithIdView>
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<T: PartialEq> PartialEq for ExecutionResult<T>
impl<T: PartialEq> PartialEq for ExecutionResult<T>
impl<T: Eq> Eq for ExecutionResult<T>
impl<T> StructuralPartialEq for ExecutionResult<T>
Auto Trait Implementations§
impl<T> Freeze for ExecutionResult<T>where
T: Freeze,
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§
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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