Trait tea_sdk::OptionExt

pub trait OptionExt {
    type Value;

    fn ok_or_err<S>(
        self,
        name: impl Into<String>
    ) -> Result<Self::Value, Error<S>>
    where
        S: Scope
; fn ok_or_err_else<S, N, F>(
        self,
        name_factory: F
    ) -> Result<Self::Value, Error<S>>
    where
        S: Scope,
        N: Into<String>,
        F: FnOnce() -> N
; }
Expand description

A helper trait to map None conditions to tea Errors

Required Associated Types§

Required Methods§

Map None condition to an error message with a const name of some value that is expected not to be None.

Map None condition to an error message with a function generatred name of some value that is expected not to be None.

Implementations on Foreign Types§

Implementors§