pub struct DynSolError { /* private fields */ }
Expand description
A dynamic ABI error.
This is a representation of a Solidity error, which can be used to decode error events.
Implementations§
Source§impl DynSolError
impl DynSolError
Sourcepub fn revert() -> Self
pub fn revert() -> Self
Represents a standard Solidity revert. These are thrown by
revert(reason)
or require(condition, reason)
statements in Solidity.
Note: Usage of this instantiator is not recommended. It is better to use alloy_sol_types::Revert in almost all cases.
Sourcepub fn panic() -> Self
pub fn panic() -> Self
Note: Usage of this instantiator is not recommended. It is better to use alloy_sol_types::Panic in almost all cases.
These are thrown by assert(condition)
and by internal Solidity checks,
such as arithmetic overflow or array bounds checks.
The list of all known panic codes can be found in the PanicKind enum.
Sourcepub const fn new_unchecked(selector: Selector, body: DynSolType) -> Self
pub const fn new_unchecked(selector: Selector, body: DynSolType) -> Self
Creates a new error, without length-checking the body. This allows creation of invalid errors.
Sourcepub fn new(selector: Selector, body: DynSolType) -> Option<Self>
pub fn new(selector: Selector, body: DynSolType) -> Option<Self>
Creates a new error from a selector.
Sourcepub const fn selector(&self) -> Selector
pub const fn selector(&self) -> Selector
Error selector is the first 4 bytes of the keccak256 hash of the error declaration.
Sourcepub fn body(&self) -> &[DynSolType]
pub fn body(&self) -> &[DynSolType]
Error body types.
Sourcepub fn decode_error(&self, data: &[u8]) -> Result<DecodedError>
pub fn decode_error(&self, data: &[u8]) -> Result<DecodedError>
Decode the error from the given data.
Trait Implementations§
Source§impl Clone for DynSolError
impl Clone for DynSolError
Source§fn clone(&self) -> DynSolError
fn clone(&self) -> DynSolError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for DynSolError
impl Debug for DynSolError
Source§impl PartialEq for DynSolError
impl PartialEq for DynSolError
Source§impl Specifier<DynSolError> for Error
impl Specifier<DynSolError> for Error
Source§fn resolve(&self) -> Result<DynSolError>
fn resolve(&self) -> Result<DynSolError>
impl StructuralPartialEq for DynSolError
Auto Trait Implementations§
impl Freeze for DynSolError
impl RefUnwindSafe for DynSolError
impl Send for DynSolError
impl Sync for DynSolError
impl Unpin for DynSolError
impl UnwindSafe for DynSolError
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
)