pub trait OkOrBadRequest {
    type S;

    // Required method
    fn ok_or_bad_request<M: AsRef<str>>(
        self,
        reason: M
    ) -> Result<Self::S, CommonError>;
}
Expand description

Trait to map error to the Bad Request error code

Required Associated Types§

source

type S

Required Methods§

source

fn ok_or_bad_request<M: AsRef<str>>( self, reason: M ) -> Result<Self::S, CommonError>

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T> OkOrBadRequest for Option<T>

§

type S = T

source§

fn ok_or_bad_request<M: AsRef<str>>(self, reason: M) -> Result<T, CommonError>

source§

impl<T, E> OkOrBadRequest for Result<T, E>
where E: Display,

§

type S = T

source§

fn ok_or_bad_request<M: AsRef<str>>(self, reason: M) -> Result<T, CommonError>

Implementors§