pub enum Error {
TypeCheckFail {
expected_type: Cow<'static, str>,
data: String,
},
Overrun,
Reserve(TryReserveError),
BufferNotEmpty,
ReserMismatch,
RecursionLimitExceeded(u8),
InvalidEnumValue {
name: &'static str,
value: u8,
max: u8,
},
InvalidLog {
name: &'static str,
log: Box<LogData>,
},
UnknownSelector {
name: &'static str,
selector: FixedBytes<4>,
},
FromHexError(FromHexError),
Other(Cow<'static, str>),
}
Expand description
ABI Encoding and Decoding errors.
Variants§
TypeCheckFail
A typecheck detected a word that does not match the data type.
Fields
Overrun
Overran deserialization buffer.
Reserve(TryReserveError)
Allocation failed.
BufferNotEmpty
Trailing bytes in deserialization buffer.
ReserMismatch
Validation reserialization did not match input.
RecursionLimitExceeded(u8)
ABI Decoding recursion limit exceeded.
InvalidEnumValue
Invalid enum value.
Fields
InvalidLog
Could not decode an event from log topics.
UnknownSelector
Unknown selector.
FromHexError(FromHexError)
Hex error.
Other(Cow<'static, str>)
Other errors.
Implementations§
Source§impl Error
impl Error
Sourcepub fn custom(s: impl Into<Cow<'static, str>>) -> Self
pub fn custom(s: impl Into<Cow<'static, str>>) -> Self
Instantiates a new error with a static str.
Sourcepub fn type_check_fail_sig(data: &[u8], signature: &'static str) -> Self
pub fn type_check_fail_sig(data: &[u8], signature: &'static str) -> Self
Instantiates a new Error::TypeCheckFail
with the provided data.
Sourcepub fn type_check_fail_token<T: SolType>(token: &T::Token<'_>) -> Self
pub fn type_check_fail_token<T: SolType>(token: &T::Token<'_>) -> Self
Instantiates a new Error::TypeCheckFail
with the provided token.
Sourcepub fn type_check_fail(
data: &[u8],
expected_type: impl Into<Cow<'static, str>>,
) -> Self
pub fn type_check_fail( data: &[u8], expected_type: impl Into<Cow<'static, str>>, ) -> Self
Instantiates a new Error::TypeCheckFail
with the provided data.
Sourcepub fn unknown_selector(name: &'static str, selector: [u8; 4]) -> Self
pub fn unknown_selector(name: &'static str, selector: [u8; 4]) -> Self
Instantiates a new Error::UnknownSelector
with the provided data.
Trait Implementations§
Source§impl Error for Error
Available on crate feature std
only.
impl Error for Error
Available on crate feature
std
only.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 From<FromHexError> for Error
impl From<FromHexError> for Error
Source§fn from(value: FromHexError) -> Self
fn from(value: FromHexError) -> Self
Converts to this type from the input type.
Source§impl From<TryReserveError> for Error
impl From<TryReserveError> for Error
Source§fn from(value: TryReserveError) -> Self
fn from(value: TryReserveError) -> Self
Converts to this type from the input type.
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
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
)