pub trait EvmError:
Sized
+ Error
+ Send
+ Sync
+ 'static {
type InvalidTransaction: InvalidTxError;
// Required methods
fn as_invalid_tx_err(&self) -> Option<&Self::InvalidTransaction>;
fn try_into_invalid_tx_err(self) -> Result<Self::InvalidTransaction, Self>;
// Provided method
fn is_invalid_tx_err(&self) -> bool { ... }
}Expand description
Abstraction over errors that can occur during EVM execution.
It’s assumed that errors can occur either because of an invalid transaction, meaning that other transaction might still result in successful execution, or because of a general EVM misconfiguration.
If caller occurs a error different from EvmError::InvalidTransaction, it should most likely
be treated as fatal error flagging some EVM misconfiguration.
Required Associated Types§
Sourcetype InvalidTransaction: InvalidTxError
type InvalidTransaction: InvalidTxError
Errors which might occur as a result of an invalid transaction. i.e unrelated to general EVM configuration.
Required Methods§
Sourcefn as_invalid_tx_err(&self) -> Option<&Self::InvalidTransaction>
fn as_invalid_tx_err(&self) -> Option<&Self::InvalidTransaction>
Returns the EvmError::InvalidTransaction if the error is an invalid transaction error.
Sourcefn try_into_invalid_tx_err(self) -> Result<Self::InvalidTransaction, Self>
fn try_into_invalid_tx_err(self) -> Result<Self::InvalidTransaction, Self>
Attempts to convert the error into EvmError::InvalidTransaction.
Provided Methods§
Sourcefn is_invalid_tx_err(&self) -> bool
fn is_invalid_tx_err(&self) -> bool
Returns true if the error is an invalid transaction error.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.