Skip to main content

CheckpointOptionExt

Trait CheckpointOptionExt 

Source
pub trait CheckpointOptionExt<T> {
    // 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 Option that provides checkpoint-based revert on None.

Required Methods§

Source

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

Returns the Some value, or reverts to the checkpoint on None.

Source

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

Returns the Some value, or logs the message and reverts to the checkpoint on None.

Implementations on Foreign Types§

Source§

impl<T> CheckpointOptionExt<T> for Option<T>

Source§

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

Source§

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

Implementors§