pub struct Panic {
pub code: U256,
}
Expand description
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.
Fields§
§code: U256
The Solidity panic code.
Implementations§
Trait Implementations§
Source§impl Error for Panic
Available on crate feature std
only.
impl Error for Panic
Available on crate feature
std
only.1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl<T> From<Panic> for ContractError<T>
impl<T> From<Panic> for ContractError<T>
Source§impl SolError for Panic
impl SolError for Panic
Source§type Parameters<'a> = (Uint<256>,)
type Parameters<'a> = (Uint<256>,)
The underlying tuple type which represents the error’s members. Read more
Source§fn new(tuple: <Self::Parameters<'_> as SolType>::RustType) -> Self
fn new(tuple: <Self::Parameters<'_> as SolType>::RustType) -> Self
Convert from the tuple type used for ABI encoding and decoding.
Source§fn tokenize(&self) -> Self::Token<'_>
fn tokenize(&self) -> Self::Token<'_>
Convert to the token type used for EIP-712 encoding and decoding.
Source§fn abi_encoded_size(&self) -> usize
fn abi_encoded_size(&self) -> usize
The size of the error params when encoded in bytes, without the
selector.
Source§fn abi_decode_raw(data: &[u8], validate: bool) -> Result<Self>
fn abi_decode_raw(data: &[u8], validate: bool) -> Result<Self>
ABI decode this call’s arguments from the given slice, without its
selector.
Source§fn abi_decode(data: &[u8], validate: bool) -> Result<Self>
fn abi_decode(data: &[u8], validate: bool) -> Result<Self>
ABI decode this error’s arguments from the given slice, with the
selector.
Source§fn abi_encode_raw(&self, out: &mut Vec<u8>)
fn abi_encode_raw(&self, out: &mut Vec<u8>)
ABI encode the error to the given buffer without its selector.
Source§impl<T> TryFrom<ContractError<T>> for Panic
impl<T> TryFrom<ContractError<T>> for Panic
Source§type Error = ContractError<T>
type Error = ContractError<T>
The type returned in the event of a conversion error.
impl Copy for Panic
impl Eq for Panic
impl StructuralPartialEq for Panic
Auto Trait Implementations§
impl Freeze for Panic
impl RefUnwindSafe for Panic
impl Send for Panic
impl Sync for Panic
impl Unpin for Panic
impl UnwindSafe for Panic
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
)