pub struct ExecutionFinalResult {
pub details: ExecutionDetails,
/* private fields */
}Expand description
Execution related info found after performing a transaction. Can be converted
into ExecutionSuccess or [ExecutionFailure] through into_result
Fields§
§details: ExecutionDetailsImplementations§
source§impl ExecutionFinalResult
impl ExecutionFinalResult
sourcepub fn into_result(self) -> Result<ExecutionSuccess>
pub fn into_result(self) -> Result<ExecutionSuccess>
Converts this object into a Result holding either ExecutionSuccess or [ExecutionFailure].
pub fn total_gas_burnt(&self) -> NearGas
sourcepub fn unwrap(self) -> ExecutionSuccess
pub fn unwrap(self) -> ExecutionSuccess
Returns the contained Ok value, consuming the self value.
Because this function may panic, its use is generally discouraged. Instead, prefer
to call into into_result then pattern matching and handle the Err case explicitly.
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.
sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Checks whether the transaction was successful. Returns true if
the transaction has a status of FinalExecutionStatus::SuccessValue.
sourcepub fn is_failure(&self) -> bool
pub fn is_failure(&self) -> bool
Checks whether the transaction has failed. Returns true if
the transaction has a status of FinalExecutionStatus::Failure.
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.
pub fn status(&self) -> &FinalExecutionStatus
Trait Implementations§
source§impl Clone for ExecutionFinalResult
impl Clone for ExecutionFinalResult
source§fn clone(&self) -> ExecutionFinalResult
fn clone(&self) -> ExecutionFinalResult
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for ExecutionFinalResult
impl Debug for ExecutionFinalResult
source§impl PartialEq for ExecutionFinalResult
impl PartialEq for ExecutionFinalResult
impl Eq for ExecutionFinalResult
impl StructuralPartialEq for ExecutionFinalResult
Auto Trait Implementations§
impl Freeze for ExecutionFinalResult
impl RefUnwindSafe for ExecutionFinalResult
impl Send for ExecutionFinalResult
impl Sync for ExecutionFinalResult
impl Unpin for ExecutionFinalResult
impl UnwindSafe for ExecutionFinalResult
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