Trait tea_codec::OptionExt

source ·
pub trait OptionExt {
    type Value;

    // Required methods
    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;
}

Required Associated Types§

Required Methods§

source

fn ok_or_err<S>(self, name: impl Into<String>) -> Result<Self::Value, Error<S>>where S: Scope,

source

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,

Implementations on Foreign Types§

source§

impl<T> OptionExt for Option<T>

§

type Value = T

source§

fn ok_or_err<S>(self, name: impl Into<String>) -> Result<Self::Value, Error<S>>where S: Scope,

source§

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,

Implementors§