Skip to main content

CheckpointResultExt

Trait CheckpointResultExt 

Source
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§

Source

fn unwrap_or_revert(self, checkpoint: &Checkpoint) -> T

Returns the Ok value, or reverts to the checkpoint on Err.

Source

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".

Implementations on Foreign Types§

Source§

impl<T, E> CheckpointResultExt<T, E> for Result<T, E>

Source§

fn unwrap_or_revert(self, checkpoint: &Checkpoint) -> T

Source§

fn expect_or_revert(self, checkpoint: &Checkpoint, msg: &str) -> T

Implementors§