[−][src]Struct oxide_auth::frontends::simple::request::MapErr
Changes the error type of a web request and response.
Methods
impl<W, F, T> MapErr<W, F, T>[src]
pub fn request(request: W, f: F) -> Self where
W: WebRequest,
F: FnMut(W::Error) -> T, [src]
W: WebRequest,
F: FnMut(W::Error) -> T,
Map all errors in request methods using the given function.
pub fn response(response: W, f: F) -> Self where
W: WebResponse,
F: FnMut(W::Error) -> T, [src]
W: WebResponse,
F: FnMut(W::Error) -> T,
Map all errors in response methods using the given function.
pub fn into_inner(self) -> W[src]
Recover original response or request.
Trait Implementations
impl<W: WebRequest, F, T> WebRequest for MapErr<W, F, T> where
F: FnMut(W::Error) -> T, [src]
F: FnMut(W::Error) -> T,
type Error = T
The error generated from access of malformed or invalid requests.
type Response = MapErr<W::Response, F, T>
The corresponding type of Responses returned from this module.
fn query(&mut self) -> Result<Cow<dyn QueryParameter + 'static>, Self::Error>[src]
fn urlbody(&mut self) -> Result<Cow<dyn QueryParameter + 'static>, Self::Error>[src]
fn authheader(&mut self) -> Result<Option<Cow<str>>, Self::Error>[src]
impl<W: WebResponse, F, T> WebResponse for MapErr<W, F, T> where
F: FnMut(W::Error) -> T, [src]
F: FnMut(W::Error) -> T,
type Error = T
The error generated when trying to construct an unhandled or invalid response.
fn ok(&mut self) -> Result<(), Self::Error>[src]
fn redirect(&mut self, url: Url) -> Result<(), Self::Error>[src]
A response which will redirect the user-agent to which the response is issued.
fn client_error(&mut self) -> Result<(), Self::Error>[src]
Set the response status to 400.
fn unauthorized(&mut self, header_value: &str) -> Result<(), Self::Error>[src]
Set the response status to 401 and add a WWW-Authenticate header.
fn body_text(&mut self, text: &str) -> Result<(), Self::Error>[src]
A pure text response with no special media type set.
fn body_json(&mut self, data: &str) -> Result<(), Self::Error>[src]
Json repsonse data, with media type `aplication/json.
Auto Trait Implementations
impl<W, F, T> Unpin for MapErr<W, F, T> where
F: Unpin,
T: Unpin,
W: Unpin,
F: Unpin,
T: Unpin,
W: Unpin,
impl<W, F, T> Send for MapErr<W, F, T> where
F: Send,
T: Send,
W: Send,
F: Send,
T: Send,
W: Send,
impl<W, F, T> Sync for MapErr<W, F, T> where
F: Sync,
T: Sync,
W: Sync,
F: Sync,
T: Sync,
W: Sync,
impl<W, F, T> RefUnwindSafe for MapErr<W, F, T> where
F: RefUnwindSafe,
T: RefUnwindSafe,
W: RefUnwindSafe,
F: RefUnwindSafe,
T: RefUnwindSafe,
W: RefUnwindSafe,
impl<W, F, T> UnwindSafe for MapErr<W, F, T> where
F: UnwindSafe,
T: UnwindSafe,
W: UnwindSafe,
F: UnwindSafe,
T: UnwindSafe,
W: UnwindSafe,
Blanket Implementations
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Erased for T
impl<T> Typeable for T where
T: Any,
T: Any,
impl<T> UnsafeAny for T where
T: Any,
T: Any,
impl<T> IntoCollection<T> for T
fn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>,
A: Array<Item = T>,
fn mapped<U, F, A>(self, f: F) -> SmallVec<A> where
A: Array<Item = U>,
F: FnMut(T) -> U,
A: Array<Item = U>,
F: FnMut(T) -> U,
impl<T, I> AsResult<T, I> for T where
I: Input,
I: Input,