Trait ink_env::call::utils::Unwrap

source ·
pub trait Unwrap {
    type Output;

    // Required method
    fn unwrap_or_else<F>(self, f: F) -> Self::Output
       where F: FnOnce() -> Self::Output;
}
Expand description

Implemented by Set and Unset in order to unwrap their value.

This is useful in case the use-site does not know if it is working with a set or an unset value generically unwrap it using a closure for fallback.

Required Associated Types§

source

type Output

The output type of the unwrap_or_else operation.

Required Methods§

source

fn unwrap_or_else<F>(self, f: F) -> Self::Outputwhere F: FnOnce() -> Self::Output,

Returns the set value or evaluates the given closure.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T> Unwrap for Set<T>

§

type Output = T

source§

impl<T> Unwrap for Unset<T>

§

type Output = T