Type Alias precompile_utils::solidity::revert::MayRevert
source · pub type MayRevert<T = ()> = Result<T, Revert>;
Expand description
Represent the result of a computation that can revert.
Aliased Type§
enum MayRevert<T = ()> {
Ok(T),
Err(Revert),
}
Variants§
Trait Implementations§
source§impl<T> BacktraceExt for MayRevert<T>
impl<T> BacktraceExt for MayRevert<T>
source§fn map_in_tuple_to_field(self, fields: &[&'static str]) -> Self
fn map_in_tuple_to_field(self, fields: &[&'static str]) -> Self
Map last tuple entry into a field.
Does nothing if last entry is not a tuple.
As in Solidity structs are equivalent to tuples and are tricky to parse correctly,
it allows to parse any struct as a tuple (with the correct implementation in this crate) and
then map tuple indices to struct fields.
source§impl<T> InjectBacktrace for MayRevert<T>
impl<T> InjectBacktrace for MayRevert<T>
source§impl<T> RevertExt for MayRevert<T>
impl<T> RevertExt for MayRevert<T>
source§fn map_reason(self, f: impl FnOnce(RevertReason) -> RevertReason) -> Self
fn map_reason(self, f: impl FnOnce(RevertReason) -> RevertReason) -> Self
Map the reason while keeping the same backtrace.