pub struct Revert {
pub reason: String,
}
Expand description
Represents a standard Solidity revert. These are thrown by revert(reason)
or require(condition, reason)
statements in Solidity.
Fields§
§reason: String
The reason string, provided by the Solidity contract.
Implementations§
Trait Implementations§
Source§impl Error for Revert
Available on crate feature std
only.
impl Error for Revert
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<Revert> for ContractError<T>
impl<T> From<Revert> for ContractError<T>
Source§impl<T> From<Revert> for RevertReason<T>
impl<T> From<Revert> for RevertReason<T>
Converts a Revert
into a RevertReason<T>
.
Source§impl SolError for Revert
impl SolError for Revert
Source§type Parameters<'a> = (String,)
type Parameters<'a> = (String,)
The underlying tuple type which represents the error’s members. Read more
Source§type Token<'a> = (PackedSeqToken<'a>,)
type Token<'a> = (PackedSeqToken<'a>,)
The corresponding
TokenSeq
type.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 Revert
impl<T> TryFrom<ContractError<T>> for Revert
Source§type Error = ContractError<T>
type Error = ContractError<T>
The type returned in the event of a conversion error.
impl Eq for Revert
impl StructuralPartialEq for Revert
Auto Trait Implementations§
impl Freeze for Revert
impl RefUnwindSafe for Revert
impl Send for Revert
impl Sync for Revert
impl Unpin for Revert
impl UnwindSafe for Revert
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
)