pub enum TraceResult<Ok, Err> {
Success {
result: Ok,
tx_hash: Option<TxHash>,
},
Error {
error: Err,
tx_hash: Option<TxHash>,
},
}
Expand description
The result of a single transaction trace.
Variants§
Implementations§
source§impl<Ok, Err> TraceResult<Ok, Err>
impl<Ok, Err> TraceResult<Ok, Err>
sourcepub const fn tx_hash(&self) -> Option<TxHash>
pub const fn tx_hash(&self) -> Option<TxHash>
Returns the hash of the transaction that was traced.
sourcepub const fn success(&self) -> Option<&Ok>
pub const fn success(&self) -> Option<&Ok>
Returns a reference to the result if it is a success variant.
sourcepub const fn error(&self) -> Option<&Err>
pub const fn error(&self) -> Option<&Err>
Returns a reference to the error if it is an error variant.
sourcepub const fn is_success(&self) -> bool
pub const fn is_success(&self) -> bool
Checks if the result is a success.
sourcepub const fn new_success(result: Ok, tx_hash: Option<TxHash>) -> Self
pub const fn new_success(result: Ok, tx_hash: Option<TxHash>) -> Self
Creates a new success trace result.
Trait Implementations§
source§impl<Ok: Clone, Err: Clone> Clone for TraceResult<Ok, Err>
impl<Ok: Clone, Err: Clone> Clone for TraceResult<Ok, Err>
source§fn clone(&self) -> TraceResult<Ok, Err>
fn clone(&self) -> TraceResult<Ok, Err>
Returns a copy 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<'de, Ok, Err> Deserialize<'de> for TraceResult<Ok, Err>where
Ok: Deserialize<'de>,
Err: Deserialize<'de>,
impl<'de, Ok, Err> Deserialize<'de> for TraceResult<Ok, Err>where
Ok: Deserialize<'de>,
Err: Deserialize<'de>,
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
source§impl<Ok, Err> Serialize for TraceResult<Ok, Err>
impl<Ok, Err> Serialize for TraceResult<Ok, Err>
impl<Ok: Eq, Err: Eq> Eq for TraceResult<Ok, Err>
impl<Ok, Err> StructuralPartialEq for TraceResult<Ok, Err>
Auto Trait Implementations§
impl<Ok, Err> Freeze for TraceResult<Ok, Err>
impl<Ok, Err> RefUnwindSafe for TraceResult<Ok, Err>where
Ok: RefUnwindSafe,
Err: RefUnwindSafe,
impl<Ok, Err> Send for TraceResult<Ok, Err>
impl<Ok, Err> Sync for TraceResult<Ok, Err>
impl<Ok, Err> Unpin for TraceResult<Ok, Err>
impl<Ok, Err> UnwindSafe for TraceResult<Ok, Err>where
Ok: UnwindSafe,
Err: 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
Mutably borrows from an owned value. Read more
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)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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