Struct xitca_web::WebContext
source · pub struct WebContext<'a, C = (), B = RequestBody> { /* private fields */ }Expand description
web context type focus on stateful and side effect based request data access.
Implementations§
source§impl<'a, C, B> WebContext<'a, C, B>
impl<'a, C, B> WebContext<'a, C, B>
sourcepub fn reborrow(&mut self) -> WebContext<'_, C, B>
pub fn reborrow(&mut self) -> WebContext<'_, C, B>
Reborrow Self so the ownership of WebRequest is not lost.
§Note:
Reborrow is not pure and receiver of it can mutate Self in any way they like.
§Example:
// a function need ownership of request but not return it in output.
fn handler(req: WebContext<'_>) -> Result<(), ()> {
Err(())
}
// use reborrow to avoid pass request by value.
match handler(req.reborrow()) {
// still able to access request after handler return.
Ok(_) => assert_eq!(req.state(), &()),
Err(_) => assert_eq!(req.state(), &())
}sourcepub fn req(&self) -> &WebRequest<()>
pub fn req(&self) -> &WebRequest<()>
Get an immutable reference of WebRequest
sourcepub fn req_mut(&mut self) -> &mut WebRequest<()>
pub fn req_mut(&mut self) -> &mut WebRequest<()>
Get a mutable reference of WebRequest
sourcepub fn body(&self) -> Ref<'_, B>
pub fn body(&self) -> Ref<'_, B>
Get a immutable reference of RequestBody
sourcepub fn body_borrow_mut(&self) -> RefMut<'_, B>
pub fn body_borrow_mut(&self) -> RefMut<'_, B>
Get a mutable reference of RequestBody
sourcepub fn body_get_mut(&mut self) -> &mut B
pub fn body_get_mut(&mut self) -> &mut B
Get a mutable reference of RequestBody This API takes &mut WebRequest so it bypass runtime borrow checker and therefore has zero runtime overhead.
pub fn take_request(&mut self) -> WebRequest<B>where
B: Default,
sourcepub fn into_response<ResB: Into<ResponseBody>>(self, body: ResB) -> WebResponse
pub fn into_response<ResB: Into<ResponseBody>>(self, body: ResB) -> WebResponse
Transform self to a WebResponse with given body type.
The heap allocation of request would be re-used.
sourcepub fn as_response<ResB: Into<ResponseBody>>(
&mut self,
body: ResB
) -> WebResponse
pub fn as_response<ResB: Into<ResponseBody>>( &mut self, body: ResB ) -> WebResponse
Transform &mut self to a WebResponse with given body type.
The heap allocation of request would be re-used.
Trait Implementations§
source§impl<C, B, T> BorrowReq<T> for WebContext<'_, C, B>
impl<C, B, T> BorrowReq<T> for WebContext<'_, C, B>
source§impl<C, B, T> BorrowReqMut<T> for WebContext<'_, C, B>
impl<C, B, T> BorrowReqMut<T> for WebContext<'_, C, B>
fn borrow_mut(&mut self) -> &mut T
source§impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for &'a Method
impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for &'a Method
source§impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for &'a WebRequest<()>
impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for &'a WebRequest<()>
type Type<'b> = &'b Request<RequestExt<()>>
type Error = Error<C>
async fn from_request( ctx: &'a WebContext<'r, C, B> ) -> Result<Self, Self::Error>
source§impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for &'a RequestExt<()>
impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for &'a RequestExt<()>
type Type<'b> = &'b RequestExt<()>
type Error = Error<C>
async fn from_request( ctx: &'a WebContext<'r, C, B> ) -> Result<Self, Self::Error>
source§impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for &'a SocketAddr
impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for &'a SocketAddr
type Type<'b> = &'b SocketAddr
type Error = Error<C>
async fn from_request( ctx: &'a WebContext<'r, C, B> ) -> Result<Self, Self::Error>
source§impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for &'a Uri
impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for &'a Uri
source§impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for &'a WebContext<'a, C, B>where
C: 'static,
B: 'static,
impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for &'a WebContext<'a, C, B>where
C: 'static,
B: 'static,
type Type<'b> = &'b WebContext<'b, C, B>
type Error = Error<C>
async fn from_request( ctx: &'a WebContext<'r, C, B> ) -> Result<Self, Self::Error>
source§impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for ()
impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for ()
source§impl<'a, 'r, C, B, const LIMIT: usize> FromRequest<'a, WebContext<'r, C, B>> for (Bytes, Limit<LIMIT>)where
B: BodyStream + Default,
impl<'a, 'r, C, B, const LIMIT: usize> FromRequest<'a, WebContext<'r, C, B>> for (Bytes, Limit<LIMIT>)where
B: BodyStream + Default,
source§impl<'a, 'r, C, B, const LIMIT: usize> FromRequest<'a, WebContext<'r, C, B>> for (BytesMut, Limit<LIMIT>)where
B: BodyStream + Default,
impl<'a, 'r, C, B, const LIMIT: usize> FromRequest<'a, WebContext<'r, C, B>> for (BytesMut, Limit<LIMIT>)where
B: BodyStream + Default,
source§impl<'a, 'r, C, B, const LIMIT: usize> FromRequest<'a, WebContext<'r, C, B>> for (Vec<u8>, Limit<LIMIT>)where
B: BodyStream + Default,
impl<'a, 'r, C, B, const LIMIT: usize> FromRequest<'a, WebContext<'r, C, B>> for (Vec<u8>, Limit<LIMIT>)where
B: BodyStream + Default,
source§impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for Body<B>where
B: BodyStream + Default,
impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for Body<B>where
B: BodyStream + Default,
source§impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for Byteswhere
B: BodyStream + Default,
impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for Byteswhere
B: BodyStream + Default,
source§impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for BytesMutwhere
B: BodyStream + Default,
impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for BytesMutwhere
B: BodyStream + Default,
source§impl<'a, 'r, C, B, K> FromRequest<'a, WebContext<'r, C, B>> for CookieJar<K>
impl<'a, 'r, C, B, K> FromRequest<'a, WebContext<'r, C, B>> for CookieJar<K>
source§impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for ExtensionKey
impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for ExtensionKey
type Type<'b> = ExtensionKey
type Error = Error<C>
async fn from_request( ctx: &'a WebContext<'r, C, B> ) -> Result<Self, Self::Error>
source§impl<'a, 'r, C, B, T> FromRequest<'a, WebContext<'r, C, B>> for ExtensionOwn<T>
impl<'a, 'r, C, B, T> FromRequest<'a, WebContext<'r, C, B>> for ExtensionOwn<T>
type Type<'b> = ExtensionOwn<T>
type Error = Error<C>
async fn from_request( ctx: &'a WebContext<'r, C, B> ) -> Result<Self, Self::Error>
source§impl<'a, 'r, C, B, T> FromRequest<'a, WebContext<'r, C, B>> for ExtensionRef<'a, T>
impl<'a, 'r, C, B, T> FromRequest<'a, WebContext<'r, C, B>> for ExtensionRef<'a, T>
type Type<'b> = ExtensionRef<'b, T>
type Error = Error<C>
async fn from_request( ctx: &'a WebContext<'r, C, B> ) -> Result<Self, Self::Error>
source§impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for ExtensionsRef<'a>
impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for ExtensionsRef<'a>
type Type<'b> = ExtensionsRef<'b>
type Error = Error<C>
async fn from_request( ctx: &'a WebContext<'r, C, B> ) -> Result<Self, Self::Error>
source§impl<'a, 'r, C, B, T, const LIMIT: usize> FromRequest<'a, WebContext<'r, C, B>> for Form<T, LIMIT>
impl<'a, 'r, C, B, T, const LIMIT: usize> FromRequest<'a, WebContext<'r, C, B>> for Form<T, LIMIT>
source§impl<'a, 'r, C, B, const HEADER_NAME: usize> FromRequest<'a, WebContext<'r, C, B>> for HeaderRef<'a, HEADER_NAME>
impl<'a, 'r, C, B, const HEADER_NAME: usize> FromRequest<'a, WebContext<'r, C, B>> for HeaderRef<'a, HEADER_NAME>
source§impl<'a, 'r, C, B, T, const LIMIT: usize> FromRequest<'a, WebContext<'r, C, B>> for Json<T, LIMIT>
impl<'a, 'r, C, B, T, const LIMIT: usize> FromRequest<'a, WebContext<'r, C, B>> for Json<T, LIMIT>
source§impl<'a, 'r, C, B, T, const LIMIT: usize> FromRequest<'a, WebContext<'r, C, B>> for LazyForm<T, LIMIT>
impl<'a, 'r, C, B, T, const LIMIT: usize> FromRequest<'a, WebContext<'r, C, B>> for LazyForm<T, LIMIT>
source§impl<'a, 'r, C, B, T, const LIMIT: usize> FromRequest<'a, WebContext<'r, C, B>> for LazyJson<T, LIMIT>
impl<'a, 'r, C, B, T, const LIMIT: usize> FromRequest<'a, WebContext<'r, C, B>> for LazyJson<T, LIMIT>
source§impl<'a, 'r, C, B, T> FromRequest<'a, WebContext<'r, C, B>> for LazyParams<'a, T>
impl<'a, 'r, C, B, T> FromRequest<'a, WebContext<'r, C, B>> for LazyParams<'a, T>
type Type<'b> = LazyParams<'b, T>
type Error = Error<C>
async fn from_request( ctx: &'a WebContext<'r, C, B> ) -> Result<Self, Self::Error>
source§impl<'a, 'r, C, B, T> FromRequest<'a, WebContext<'r, C, B>> for LazyQuery<'a, T>where
T: Deserialize<'static>,
impl<'a, 'r, C, B, T> FromRequest<'a, WebContext<'r, C, B>> for LazyQuery<'a, T>where
T: Deserialize<'static>,
source§impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for Method
impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for Method
source§impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for Multipart<B>where
B: BodyStream + Default,
impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for Multipart<B>where
B: BodyStream + Default,
source§impl<'a, 'r, C, B, T> FromRequest<'a, WebContext<'r, C, B>> for Option<T>where
T: FromRequest<'a, WebContext<'r, C, B>>,
impl<'a, 'r, C, B, T> FromRequest<'a, WebContext<'r, C, B>> for Option<T>where
T: FromRequest<'a, WebContext<'r, C, B>>,
type Type<'b> = Option<<T as FromRequest<'a, WebContext<'r, C, B>>>::Type<'b>>
type Error = Error<C>
async fn from_request( ctx: &'a WebContext<'r, C, B> ) -> Result<Self, Self::Error>
source§impl<'a, 'r, T, C, B> FromRequest<'a, WebContext<'r, C, B>> for Params<T>where
T: for<'de> Deserialize<'de>,
impl<'a, 'r, T, C, B> FromRequest<'a, WebContext<'r, C, B>> for Params<T>where
T: for<'de> Deserialize<'de>,
source§impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for ParamsRef<'a>
impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for ParamsRef<'a>
source§impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for PathOwn
impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for PathOwn
source§impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for PathRef<'a>
impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for PathRef<'a>
source§impl<'a, 'r, C, B, K> FromRequest<'a, WebContext<'r, C, B>> for Private<K>
impl<'a, 'r, C, B, K> FromRequest<'a, WebContext<'r, C, B>> for Private<K>
source§impl<'a, 'r, C, B, T> FromRequest<'a, WebContext<'r, C, B>> for Query<T>where
T: for<'de> Deserialize<'de>,
impl<'a, 'r, C, B, T> FromRequest<'a, WebContext<'r, C, B>> for Query<T>where
T: for<'de> Deserialize<'de>,
source§impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for WebRequest<()>
impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for WebRequest<()>
type Type<'b> = Request<RequestExt<()>>
type Error = Error<C>
async fn from_request( ctx: &'a WebContext<'r, C, B> ) -> Result<Self, Self::Error>
source§impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for RequestExt<()>
impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for RequestExt<()>
type Type<'b> = RequestExt<()>
type Error = Error<C>
async fn from_request( ctx: &'a WebContext<'r, C, B> ) -> Result<Self, Self::Error>
source§impl<'a, 'r, C, B, T, E> FromRequest<'a, WebContext<'r, C, B>> for Result<T, E>where
T: FromRequest<'a, WebContext<'r, C, B>, Error = E>,
impl<'a, 'r, C, B, T, E> FromRequest<'a, WebContext<'r, C, B>> for Result<T, E>where
T: FromRequest<'a, WebContext<'r, C, B>, Error = E>,
type Type<'b> = Result<<T as FromRequest<'a, WebContext<'r, C, B>>>::Type<'b>, <T as FromRequest<'a, WebContext<'r, C, B>>>::Error>
type Error = Error<C>
async fn from_request( ctx: &'a WebContext<'r, C, B> ) -> Result<Self, Self::Error>
source§impl<'a, 'r, C, B, K> FromRequest<'a, WebContext<'r, C, B>> for Signed<K>
impl<'a, 'r, C, B, K> FromRequest<'a, WebContext<'r, C, B>> for Signed<K>
source§impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for SocketAddr
impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for SocketAddr
type Type<'b> = SocketAddr
type Error = Error<C>
async fn from_request( ctx: &'a WebContext<'r, C, B> ) -> Result<Self, Self::Error>
source§impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for StateKeywhere
C: Borrow<Self>,
impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for StateKeywhere
C: Borrow<Self>,
source§impl<'a, 'r, C, B, T> FromRequest<'a, WebContext<'r, C, B>> for StateOwn<T>
impl<'a, 'r, C, B, T> FromRequest<'a, WebContext<'r, C, B>> for StateOwn<T>
source§impl<'a, 'r, C, B, T> FromRequest<'a, WebContext<'r, C, B>> for StateRef<'a, T>
impl<'a, 'r, C, B, T> FromRequest<'a, WebContext<'r, C, B>> for StateRef<'a, T>
source§impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for Stringwhere
B: BodyStream + Default,
impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for Stringwhere
B: BodyStream + Default,
source§impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for Uri
impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for Uri
source§impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for UriOwn
impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for UriOwn
source§impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for UriRef<'a>
impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for UriRef<'a>
source§impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for Vec<u8>where
B: BodyStream + Default,
impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for Vec<u8>where
B: BodyStream + Default,
source§impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for WebSocket<B>where
C: 'static,
B: BodyStream + Default + 'static,
impl<'a, 'r, C, B> FromRequest<'a, WebContext<'r, C, B>> for WebSocket<B>where
C: 'static,
B: BodyStream + Default + 'static,
source§impl<C, B, I, Res, Err> IntoObject<I, ()> for WebContext<'_, C, B>
impl<C, B, I, Res, Err> IntoObject<I, ()> for WebContext<'_, C, B>
§type Object = RouteObject<(), Box<dyn for<'r> ServiceObject<WebContext<'r, C, B>, Response = Res, Error = Err>>, <I as Service>::Error>
type Object = RouteObject<(), Box<dyn for<'r> ServiceObject<WebContext<'r, C, B>, Response = Res, Error = Err>>, <I as Service>::Error>
The type-erased form of
I.source§fn into_object(inner: I) -> Self::Object
fn into_object(inner: I) -> Self::Object
Constructs
Self::Object from I.source§impl<'r, C, B> Responder<WebContext<'r, C, B>> for &'static str
impl<'r, C, B> Responder<WebContext<'r, C, B>> for &'static str
source§impl<'r, C, B, const N: usize> Responder<WebContext<'r, C, B>> for [(HeaderName, HeaderValue); N]
impl<'r, C, B, const N: usize> Responder<WebContext<'r, C, B>> for [(HeaderName, HeaderValue); N]
source§impl<'r, C, B> Responder<WebContext<'r, C, B>> for (HeaderName, HeaderValue)
impl<'r, C, B> Responder<WebContext<'r, C, B>> for (HeaderName, HeaderValue)
source§impl<'r, C, B> Responder<WebContext<'r, C, B>> for Box<str>
impl<'r, C, B> Responder<WebContext<'r, C, B>> for Box<str>
source§impl<'r, C, B> Responder<WebContext<'r, C, B>> for BoxBody
impl<'r, C, B> Responder<WebContext<'r, C, B>> for BoxBody
source§impl<'r, C, B> Responder<WebContext<'r, C, B>> for Bytes
impl<'r, C, B> Responder<WebContext<'r, C, B>> for Bytes
type Response = Response<ResponseBody>
type Error = Infallible
source§impl<'r, C, B> Responder<WebContext<'r, C, B>> for BytesMut
impl<'r, C, B> Responder<WebContext<'r, C, B>> for BytesMut
type Response = Response<ResponseBody>
type Error = Infallible
source§impl<'r, C, B, K> Responder<WebContext<'r, C, B>> for CookieJar<K>
impl<'r, C, B, K> Responder<WebContext<'r, C, B>> for CookieJar<K>
source§impl<'r, C, B> Responder<WebContext<'r, C, B>> for Cow<'static, str>
impl<'r, C, B> Responder<WebContext<'r, C, B>> for Cow<'static, str>
source§impl<'r, C, B> Responder<WebContext<'r, C, B>> for Error<C>
impl<'r, C, B> Responder<WebContext<'r, C, B>> for Error<C>
source§impl<'r, C, B> Responder<WebContext<'r, C, B>> for ErrorStatus
impl<'r, C, B> Responder<WebContext<'r, C, B>> for ErrorStatus
source§impl<'r, C, B, T> Responder<WebContext<'r, C, B>> for Form<T>where
T: Serialize,
impl<'r, C, B, T> Responder<WebContext<'r, C, B>> for Form<T>where
T: Serialize,
source§impl<'r, C, B> Responder<WebContext<'r, C, B>> for HeaderMap
impl<'r, C, B> Responder<WebContext<'r, C, B>> for HeaderMap
source§impl<'r, C, B, T> Responder<WebContext<'r, C, B>> for Html<T>where
T: Into<ResponseBody>,
impl<'r, C, B, T> Responder<WebContext<'r, C, B>> for Html<T>where
T: Into<ResponseBody>,
source§impl<'r, C, B, T> Responder<WebContext<'r, C, B>> for Json<T>where
T: Serialize,
impl<'r, C, B, T> Responder<WebContext<'r, C, B>> for Json<T>where
T: Serialize,
source§impl<'r, C, B> Responder<WebContext<'r, C, B>> for Redirect
impl<'r, C, B> Responder<WebContext<'r, C, B>> for Redirect
source§impl<'r, C, B, ResB> Responder<WebContext<'r, C, B>> for WebResponse<ResB>
impl<'r, C, B, ResB> Responder<WebContext<'r, C, B>> for WebResponse<ResB>
source§impl<'r, C, B, ResB> Responder<WebContext<'r, C, B>> for ResponseBody<ResB>
impl<'r, C, B, ResB> Responder<WebContext<'r, C, B>> for ResponseBody<ResB>
source§impl<'r, C, B, T, Res, Err, E> Responder<WebContext<'r, C, B>> for Result<T, E>where
T: for<'r2> Responder<WebContext<'r2, C, B>, Response = Res, Error = Err>,
Error<C>: From<E> + From<Err>,
impl<'r, C, B, T, Res, Err, E> Responder<WebContext<'r, C, B>> for Result<T, E>where
T: for<'r2> Responder<WebContext<'r2, C, B>, Response = Res, Error = Err>,
Error<C>: From<E> + From<Err>,
source§impl<'r, C, B> Responder<WebContext<'r, C, B>> for StatusCode
impl<'r, C, B> Responder<WebContext<'r, C, B>> for StatusCode
source§impl<'r, C, B> Responder<WebContext<'r, C, B>> for String
impl<'r, C, B> Responder<WebContext<'r, C, B>> for String
source§impl<'r, C, B, T> Responder<WebContext<'r, C, B>> for Text<T>where
T: Into<ResponseBody>,
impl<'r, C, B, T> Responder<WebContext<'r, C, B>> for Text<T>where
T: Into<ResponseBody>,
source§impl<'r, C, B> Responder<WebContext<'r, C, B>> for Value
impl<'r, C, B> Responder<WebContext<'r, C, B>> for Value
source§impl<'r, C, B> Responder<WebContext<'r, C, B>> for Vec<(HeaderName, HeaderValue)>
impl<'r, C, B> Responder<WebContext<'r, C, B>> for Vec<(HeaderName, HeaderValue)>
source§impl<'r, C, B> Responder<WebContext<'r, C, B>> for Vec<u8>
impl<'r, C, B> Responder<WebContext<'r, C, B>> for Vec<u8>
type Response = Response<ResponseBody>
type Error = Infallible
source§impl<'r, C, B> Responder<WebContext<'r, C, B>> for WebSocket<B>where
B: BodyStream + 'static,
impl<'r, C, B> Responder<WebContext<'r, C, B>> for WebSocket<B>where
B: BodyStream + 'static,
type Response = Response<ResponseBody>
type Error = Infallible
source§impl<'r, C> Service<WebContext<'r, C>> for Error<C>
impl<'r, C> Service<WebContext<'r, C>> for Error<C>
§type Response = Response<ResponseBody>
type Response = Response<ResponseBody>
The Ok part of output future.
§type Error = Infallible
type Error = Infallible
The Err part of output future.
async fn call( &self, ctx: WebContext<'r, C> ) -> Result<Self::Response, Self::Error>
source§impl<'r, C, B> Service<WebContext<'r, C, B>> for BodyOverFlow
impl<'r, C, B> Service<WebContext<'r, C, B>> for BodyOverFlow
§type Response = Response<ResponseBody>
type Response = Response<ResponseBody>
The Ok part of output future.
§type Error = Infallible
type Error = Infallible
The Err part of output future.
async fn call( &self, ctx: WebContext<'r, C, B> ) -> Result<Self::Response, Self::Error>
source§impl<'r, C, B> Service<WebContext<'r, C, B>> for Box<dyn Error + Send + Sync>
impl<'r, C, B> Service<WebContext<'r, C, B>> for Box<dyn Error + Send + Sync>
§type Response = Response<ResponseBody>
type Response = Response<ResponseBody>
The Ok part of output future.
§type Error = Infallible
type Error = Infallible
The Err part of output future.
async fn call( &self, ctx: WebContext<'r, C, B> ) -> Result<Self::Response, Self::Error>
source§impl<'r, C, B> Service<WebContext<'r, C, B>> for EncodingError
impl<'r, C, B> Service<WebContext<'r, C, B>> for EncodingError
§type Response = Response<ResponseBody>
type Response = Response<ResponseBody>
The Ok part of output future.
§type Error = Infallible
type Error = Infallible
The Err part of output future.
async fn call( &self, req: WebContext<'r, C, B> ) -> Result<Self::Response, Self::Error>
source§impl<'r, C, B> Service<WebContext<'r, C, B>> for Error
impl<'r, C, B> Service<WebContext<'r, C, B>> for Error
§type Response = Response<ResponseBody>
type Response = Response<ResponseBody>
The Ok part of output future.
§type Error = Infallible
type Error = Infallible
The Err part of output future.
async fn call( &self, ctx: WebContext<'r, C, B> ) -> Result<Self::Response, Self::Error>
source§impl<'r, C, B> Service<WebContext<'r, C, B>> for Error
impl<'r, C, B> Service<WebContext<'r, C, B>> for Error
§type Response = Response<ResponseBody>
type Response = Response<ResponseBody>
The Ok part of output future.
§type Error = Infallible
type Error = Infallible
The Err part of output future.
async fn call( &self, ctx: WebContext<'r, C, B> ) -> Result<Self::Response, Self::Error>
source§impl<'r, C, B> Service<WebContext<'r, C, B>> for Error
impl<'r, C, B> Service<WebContext<'r, C, B>> for Error
§type Response = Response<ResponseBody>
type Response = Response<ResponseBody>
The Ok part of output future.
§type Error = Infallible
type Error = Infallible
The Err part of output future.
async fn call( &self, ctx: WebContext<'r, C, B> ) -> Result<Self::Response, Self::Error>
source§impl<'r, C, B> Service<WebContext<'r, C, B>> for Error
impl<'r, C, B> Service<WebContext<'r, C, B>> for Error
§type Response = Response<ResponseBody>
type Response = Response<ResponseBody>
The Ok part of output future.
§type Error = Infallible
type Error = Infallible
The Err part of output future.
async fn call( &self, ctx: WebContext<'r, C, B> ) -> Result<Self::Response, Self::Error>
source§impl<'r, C, B> Service<WebContext<'r, C, B>> for ErrorStatus
impl<'r, C, B> Service<WebContext<'r, C, B>> for ErrorStatus
§type Response = Response<ResponseBody>
type Response = Response<ResponseBody>
The Ok part of output future.
§type Error = Infallible
type Error = Infallible
The Err part of output future.
async fn call( &self, ctx: WebContext<'r, C, B> ) -> Result<Self::Response, Self::Error>
source§impl<'r, C, B> Service<WebContext<'r, C, B>> for ExtensionNotFound
impl<'r, C, B> Service<WebContext<'r, C, B>> for ExtensionNotFound
§type Response = Response<ResponseBody>
type Response = Response<ResponseBody>
The Ok part of output future.
§type Error = Infallible
type Error = Infallible
The Err part of output future.
async fn call( &self, ctx: WebContext<'r, C, B> ) -> Result<Self::Response, Self::Error>
source§impl<'r, C, B> Service<WebContext<'r, C, B>> for FromUtf8Error
impl<'r, C, B> Service<WebContext<'r, C, B>> for FromUtf8Error
§type Response = Response<ResponseBody>
type Response = Response<ResponseBody>
The Ok part of output future.
§type Error = Infallible
type Error = Infallible
The Err part of output future.
async fn call( &self, ctx: WebContext<'r, C, B> ) -> Result<Self::Response, Self::Error>
source§impl<'r, C, B> Service<WebContext<'r, C, B>> for HandshakeError
impl<'r, C, B> Service<WebContext<'r, C, B>> for HandshakeError
§type Response = Response<ResponseBody>
type Response = Response<ResponseBody>
The Ok part of output future.
§type Error = Infallible
type Error = Infallible
The Err part of output future.
async fn call( &self, ctx: WebContext<'r, C, B> ) -> Result<Self::Response, Self::Error>
source§impl<'r, C, B> Service<WebContext<'r, C, B>> for HeaderNotFound
impl<'r, C, B> Service<WebContext<'r, C, B>> for HeaderNotFound
§type Response = Response<ResponseBody>
type Response = Response<ResponseBody>
The Ok part of output future.
§type Error = Infallible
type Error = Infallible
The Err part of output future.
async fn call( &self, ctx: WebContext<'r, C, B> ) -> Result<Self::Response, Self::Error>
source§impl<'r, C, B, T> Service<WebContext<'r, C, B>> for Html<T>
impl<'r, C, B, T> Service<WebContext<'r, C, B>> for Html<T>
source§impl<'r, C, B> Service<WebContext<'r, C, B>> for Infallible
impl<'r, C, B> Service<WebContext<'r, C, B>> for Infallible
§type Response = Response<ResponseBody>
type Response = Response<ResponseBody>
The Ok part of output future.
§type Error = Infallible
type Error = Infallible
The Err part of output future.
async fn call( &self, _: WebContext<'r, C, B> ) -> Result<Self::Response, Self::Error>
source§impl<'r, C, B> Service<WebContext<'r, C, B>> for InvalidHeaderValue
impl<'r, C, B> Service<WebContext<'r, C, B>> for InvalidHeaderValue
§type Response = Response<ResponseBody>
type Response = Response<ResponseBody>
The Ok part of output future.
§type Error = Infallible
type Error = Infallible
The Err part of output future.
async fn call( &self, ctx: WebContext<'r, C, B> ) -> Result<Self::Response, Self::Error>
source§impl<'r, C, B, T> Service<WebContext<'r, C, B>> for Json<T>
impl<'r, C, B, T> Service<WebContext<'r, C, B>> for Json<T>
source§impl<'r, S, C, B, Res, Err> Service<WebContext<'r, C, B>> for LimitService<S>where
B: BodyStream + Default,
S: for<'r2> Service<WebContext<'r2, C, LimitBody<B>>, Response = Res, Error = Err>,
impl<'r, S, C, B, Res, Err> Service<WebContext<'r, C, B>> for LimitService<S>where
B: BodyStream + Default,
S: for<'r2> Service<WebContext<'r2, C, LimitBody<B>>, Response = Res, Error = Err>,
source§impl<'r, C, B> Service<WebContext<'r, C, B>> for MatchError
impl<'r, C, B> Service<WebContext<'r, C, B>> for MatchError
§type Response = Response<ResponseBody>
type Response = Response<ResponseBody>
The Ok part of output future.
§type Error = Infallible
type Error = Infallible
The Err part of output future.
async fn call( &self, ctx: WebContext<'r, C, B> ) -> Result<Self::Response, Self::Error>
source§impl<'r, C, B> Service<WebContext<'r, C, B>> for MethodNotAllowed
impl<'r, C, B> Service<WebContext<'r, C, B>> for MethodNotAllowed
§type Response = Response<ResponseBody>
type Response = Response<ResponseBody>
The Ok part of output future.
§type Error = Infallible
type Error = Infallible
The Err part of output future.
async fn call( &self, ctx: WebContext<'r, C, B> ) -> Result<Self::Response, Self::Error>
source§impl<'r, C, B> Service<WebContext<'r, C, B>> for MultipartError
impl<'r, C, B> Service<WebContext<'r, C, B>> for MultipartError
§type Response = Response<ResponseBody>
type Response = Response<ResponseBody>
The Ok part of output future.
§type Error = Infallible
type Error = Infallible
The Err part of output future.
async fn call( &self, ctx: WebContext<'r, C, B> ) -> Result<Self::Response, Self::Error>
source§impl<'r, C, B> Service<WebContext<'r, C, B>> for ParseError
impl<'r, C, B> Service<WebContext<'r, C, B>> for ParseError
§type Response = Response<ResponseBody>
type Response = Response<ResponseBody>
The Ok part of output future.
§type Error = Infallible
type Error = Infallible
The Err part of output future.
async fn call( &self, ctx: WebContext<'r, C, B> ) -> Result<Self::Response, Self::Error>
source§impl<'r, C, B> Service<WebContext<'r, C, B>> for Redirect
impl<'r, C, B> Service<WebContext<'r, C, B>> for Redirect
source§impl<'r, C, B> Service<WebContext<'r, C, B>> for StatusCode
impl<'r, C, B> Service<WebContext<'r, C, B>> for StatusCode
§type Response = Response<ResponseBody>
type Response = Response<ResponseBody>
The Ok part of output future.
§type Error = Infallible
type Error = Infallible
The Err part of output future.
async fn call( &self, ctx: WebContext<'r, C, B> ) -> Result<Self::Response, Self::Error>
source§impl<'r, C, B> Service<WebContext<'r, C, B>> for StdError
impl<'r, C, B> Service<WebContext<'r, C, B>> for StdError
§type Response = Response<ResponseBody>
type Response = Response<ResponseBody>
The Ok part of output future.
§type Error = Infallible
type Error = Infallible
The Err part of output future.
async fn call( &self, ctx: WebContext<'r, C, B> ) -> Result<Self::Response, Self::Error>
source§impl<'r, C, B, T> Service<WebContext<'r, C, B>> for Text<T>
impl<'r, C, B, T> Service<WebContext<'r, C, B>> for Text<T>
source§impl<'r, C, B> Service<WebContext<'r, C, B>> for ThreadJoinError
impl<'r, C, B> Service<WebContext<'r, C, B>> for ThreadJoinError
§type Response = Response<ResponseBody>
type Response = Response<ResponseBody>
The Ok part of output future.
§type Error = Infallible
type Error = Infallible
The Err part of output future.
async fn call( &self, ctx: WebContext<'r, C, B> ) -> Result<Self::Response, Self::Error>
source§impl<'r, C, B> Service<WebContext<'r, C, B>> for ToStrError
impl<'r, C, B> Service<WebContext<'r, C, B>> for ToStrError
§type Response = Response<ResponseBody>
type Response = Response<ResponseBody>
The Ok part of output future.
§type Error = Infallible
type Error = Infallible
The Err part of output future.
async fn call( &self, ctx: WebContext<'r, C, B> ) -> Result<Self::Response, Self::Error>
source§impl<'r, C, B> Service<WebContext<'r, C, B>> for TooManyRequests
impl<'r, C, B> Service<WebContext<'r, C, B>> for TooManyRequests
§type Response = Response<ResponseBody>
type Response = Response<ResponseBody>
The Ok part of output future.
§type Error = Infallible
type Error = Infallible
The Err part of output future.
async fn call( &self, ctx: WebContext<'r, C, B> ) -> Result<Self::Response, Self::Error>
source§impl<'r, C, ReqB, S, ResB> Service<WebContext<'r, C, ReqB>> for TowerCompatService<S>where
S: Service<Request<CompatReqBody<RequestExt<ReqB>, C>>, Response = Response<ResB>>,
ResB: Body,
C: Clone + 'static,
ReqB: Default,
impl<'r, C, ReqB, S, ResB> Service<WebContext<'r, C, ReqB>> for TowerCompatService<S>where
S: Service<Request<CompatReqBody<RequestExt<ReqB>, C>>, Response = Response<ResB>>,
ResB: Body,
C: Clone + 'static,
ReqB: Default,
§type Response = Response<CompatResBody<ResB>>
type Response = Response<CompatResBody<ResB>>
The Ok part of output future.
§type Error = <S as Service<Request<CompatReqBody<RequestExt<ReqB>, C>>>>::Error
type Error = <S as Service<Request<CompatReqBody<RequestExt<ReqB>, C>>>>::Error
The Err part of output future.
async fn call( &self, ctx: WebContext<'r, C, ReqB> ) -> Result<Self::Response, Self::Error>
Auto Trait Implementations§
impl<'a, C = (), B = RequestBody> !RefUnwindSafe for WebContext<'a, C, B>
impl<'a, C, B> Send for WebContext<'a, C, B>
impl<'a, C = (), B = RequestBody> !Sync for WebContext<'a, C, B>
impl<'a, C, B> Unpin for WebContext<'a, C, B>
impl<'a, C = (), B = RequestBody> !UnwindSafe for WebContext<'a, C, B>
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