pub struct MapRequest<F> { /* private fields */ }Expand description
Middleware to modify a request.
Currently, this middleware only accepts an Fn(http::Request<B>) -> http::Request<B>. FromRequest[Parts] and IntoResponse return types are
going to be supported in the future.
Implementations§
Source§impl<F> MapRequest<F>
impl<F> MapRequest<F>
Trait Implementations§
Source§impl<F: Clone> Clone for MapRequest<F>
impl<F: Clone> Clone for MapRequest<F>
Source§fn clone(&self) -> MapRequest<F>
fn clone(&self) -> MapRequest<F>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<F: Debug> Debug for MapRequest<F>
impl<F: Debug> Debug for MapRequest<F>
Source§impl<S, F> HttpMiddleware<S> for MapRequest<F>
impl<S, F> HttpMiddleware<S> for MapRequest<F>
impl<F: Copy> Copy for MapRequest<F>
Auto Trait Implementations§
impl<F> Freeze for MapRequest<F>where
F: Freeze,
impl<F> RefUnwindSafe for MapRequest<F>where
F: RefUnwindSafe,
impl<F> Send for MapRequest<F>where
F: Send,
impl<F> Sync for MapRequest<F>where
F: Sync,
impl<F> Unpin for MapRequest<F>where
F: Unpin,
impl<F> UnwindSafe for MapRequest<F>where
F: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> HttpServiceExt for T
impl<T> HttpServiceExt for T
fn map_request<F>(self, f: F) -> MapRequestService<Self, F>where
Self: Sized,
fn map_response<F>(self, f: F) -> MapResponseService<Self, F>where
Self: Sized,
Source§fn set_status(self, status: StatusCode) -> SetStatusService<Self>where
Self: Sized,
fn set_status(self, status: StatusCode) -> SetStatusService<Self>where
Self: Sized,
Available on crate feature
set-status only.Source§fn set_task_local<T>(
self,
key: &'static LocalKey<T>,
value: T,
) -> SetTaskLocalService<Self, T>
fn set_task_local<T>( self, key: &'static LocalKey<T>, value: T, ) -> SetTaskLocalService<Self, T>
Available on crate feature
task-local only.