pub trait OptionReport {
    type Some;

    // Required methods
    fn ok_or_not_found(self) -> Result<Self::Some, Report<NotFound>>;
    fn ok_or_not_found_kv<K, V>(
        self,
        key: K,
        value: V
    ) -> Result<Self::Some, Report<NotFound>>
       where K: Display,
             V: Display;
    fn ok_or_not_found_field(
        self,
        field: &'static str
    ) -> Result<Self::Some, Report<NotFound>>;
    fn ok_or_not_found_by<K: Display>(
        self,
        key: K
    ) -> Result<Self::Some, Report<NotFound>>;
}
Expand description

Used to produce NotFound reports from an Option

Required Associated Types§

Required Methods§

source

fn ok_or_not_found(self) -> Result<Self::Some, Report<NotFound>>

source

fn ok_or_not_found_kv<K, V>( self, key: K, value: V ) -> Result<Self::Some, Report<NotFound>>
where K: Display, V: Display,

source

fn ok_or_not_found_field( self, field: &'static str ) -> Result<Self::Some, Report<NotFound>>

source

fn ok_or_not_found_by<K: Display>( self, key: K ) -> Result<Self::Some, Report<NotFound>>

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T> OptionReport for Option<T>

§

type Some = T

source§

fn ok_or_not_found(self) -> Result<T, Report<NotFound>>

source§

fn ok_or_not_found_kv<K, V>( self, key: K, value: V ) -> Result<T, Report<NotFound>>
where K: Display, V: Display,

source§

fn ok_or_not_found_field( self, field: &'static str ) -> Result<T, Report<NotFound>>

source§

fn ok_or_not_found_by<K: Display>(self, key: K) -> Result<T, Report<NotFound>>

Implementors§