pub trait CheckpointResultExt<T, E> {
// Required methods
fn unwrap_or_revert(self, checkpoint: &Checkpoint) -> T;
fn expect_or_revert(self, checkpoint: &Checkpoint, msg: &str) -> T;
}Expand description
Extension trait for Result that provides checkpoint-based revert on error.
Required Methods§
Sourcefn unwrap_or_revert(self, checkpoint: &Checkpoint) -> T
fn unwrap_or_revert(self, checkpoint: &Checkpoint) -> T
Returns the Ok value, or reverts to the checkpoint on Err.
Sourcefn expect_or_revert(self, checkpoint: &Checkpoint, msg: &str) -> T
fn expect_or_revert(self, checkpoint: &Checkpoint, msg: &str) -> T
Returns the Ok value, or logs the message and reverts to the checkpoint on Err.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".