pub trait OptionExt: Sealed + Sized {
    fn or_not_found<I>(
        self,
        entity: &'static str,
        identifier: I
    ) -> Result<Self::Value>
    where
        I: Display
; fn or_not_found_unknown(self, entity: &'static str) -> Result<Self::Value>; }
Expand description

Extension methods on Option<T>.

Required Methods

Returns Ok(_) if the source is Some(_), otherwise, returns a Problem that can downcast to NotFound.

Errors

Returns Err when self is None.

It’s a wrapper to or_not_found to be used when there is no a specific identifier to entity message.

Returns Ok(_) if the source is Some(_), otherwise, returns a Problem that can downcast to NotFound.

Errors

Returns Err when self is None.

Implementations on Foreign Types

Implementors