Struct xitca_web::middleware::sync::SyncMiddleware
source · pub struct SyncMiddleware<F>(/* private fields */);Expand description
experimental type for sync function as middleware.
Implementations§
source§impl<F> SyncMiddleware<F>
impl<F> SyncMiddleware<F>
sourcepub fn new<C, E>(func: F) -> Self
pub fn new<C, E>(func: F) -> Self
*. Sync middleware does not have access to request/response body.
construct a new middleware with given sync function. the function must be actively calling Next::call and finish it to drive inner services to completion. panic in sync function middleware would result in a panic at task level and it’s client connection would be terminated immediately.
Trait Implementations§
Auto Trait Implementations§
impl<F> RefUnwindSafe for SyncMiddleware<F>where
F: RefUnwindSafe,
impl<F> Send for SyncMiddleware<F>where
F: Send,
impl<F> Sync for SyncMiddleware<F>where
F: Sync,
impl<F> Unpin for SyncMiddleware<F>where
F: Unpin,
impl<F> UnwindSafe for SyncMiddleware<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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<S, Arg> ServiceExt<Arg> for Swhere
S: Service<Arg>,
impl<S, Arg> ServiceExt<Arg> for Swhere
S: Service<Arg>,
source§fn enclosed<T>(self, build: T) -> Pipeline<Self, T, BuildEnclosed>
fn enclosed<T>(self, build: T) -> Pipeline<Self, T, BuildEnclosed>
Enclose Self with given
T as Service<<Self as Service<_>>::Response>>. In other word T
would take Self’s Service::Response type as it’s generic argument of Service<_> impl.source§fn enclosed_fn<T, Req>(self, func: T) -> Pipeline<Self, T, BuildEnclosedFn>
fn enclosed_fn<T, Req>(self, func: T) -> Pipeline<Self, T, BuildEnclosedFn>
Function version of Self::enclosed method.
source§fn map<F, Res, ResMap>(self, mapper: F) -> Pipeline<Self, F, BuildMap>
fn map<F, Res, ResMap>(self, mapper: F) -> Pipeline<Self, F, BuildMap>
Mutate
<<Self::Response as Service<Req>>::Future as Future>::Output type with given
closure.