pub type EvmErrored<Db, Insp = NoOpInspector, E = EVMError<<Db as Database>::Error>> = Trevm<Db, Insp, ErroredState<E>>;Expand description
A Trevm that encountered an error during transaction execution.
Expected continuations include:
Aliased Type§
pub struct EvmErrored<Db, Insp = NoOpInspector, E = EVMError<<Db as Database>::Error>> { /* private fields */ }Implementations§
Source§impl<Db, Insp, E> EvmErrored<Db, Insp, E>
impl<Db, Insp, E> EvmErrored<Db, Insp, E>
Sourcepub fn inspect_err<F, T>(&self, f: F) -> T
pub fn inspect_err<F, T>(&self, f: F) -> T
Inspect the error with a closure.
Sourcepub fn discard_error(self) -> EvmNeedsTx<Db, Insp>
pub fn discard_error(self) -> EvmNeedsTx<Db, Insp>
Discard the error and return the EVM.
Sourcepub fn into_error(self) -> E
pub fn into_error(self) -> E
Convert the error into an EVMError.
Sourcepub fn take_err(self) -> (E, EvmNeedsTx<Db, Insp>)
pub fn take_err(self) -> (E, EvmNeedsTx<Db, Insp>)
Reset the EVM, returning the error and the EVM ready for the next transaction.
Sourcepub fn err_into<NewErr: From<E>>(self) -> EvmErrored<Db, Insp, NewErr>
pub fn err_into<NewErr: From<E>>(self) -> EvmErrored<Db, Insp, NewErr>
Transform the error into a new error type.
Sourcepub fn map_err<F, NewErr>(self, f: F) -> EvmErrored<Db, Insp, NewErr>where
F: FnOnce(E) -> NewErr,
pub fn map_err<F, NewErr>(self, f: F) -> EvmErrored<Db, Insp, NewErr>where
F: FnOnce(E) -> NewErr,
Map the error to a new error type.
Source§impl<Db, Insp> EvmErrored<Db, Insp>
impl<Db, Insp> EvmErrored<Db, Insp>
Sourcepub const fn is_transaction_error(&self) -> bool
pub const fn is_transaction_error(&self) -> bool
Check if the error is a transaction error. This is provided as a convenience function for common cases, as Transaction errors should usually be discarded.
Sourcepub const fn as_transaction_error(&self) -> Option<&InvalidTransaction>
pub const fn as_transaction_error(&self) -> Option<&InvalidTransaction>
Fallible cast to a InvalidTransaction.
Sourcepub fn discard_transaction_error(self) -> Result<EvmNeedsTx<Db, Insp>, Self>
pub fn discard_transaction_error(self) -> Result<EvmNeedsTx<Db, Insp>, Self>
Discard the error if it is a transaction error, returning the EVM. If the error is not a transaction error, return self