#[non_exhaustive]pub struct MissingRequestContext;Expand description
Rejection returned when RequestContext is extracted without the
observability middleware installed.
Handlers can explicitly retain the typed rejection when middleware is optional during composition:
use axum_observability::{MissingRequestContext, RequestContext};
async fn request_id(
context: Result<RequestContext, MissingRequestContext>,
) -> Result<String, MissingRequestContext> {
Ok(context?.request_id().to_string())
}Trait Implementations§
Source§impl Clone for MissingRequestContext
impl Clone for MissingRequestContext
impl Copy for MissingRequestContext
Source§impl Debug for MissingRequestContext
impl Debug for MissingRequestContext
Source§impl Display for MissingRequestContext
impl Display for MissingRequestContext
impl Eq for MissingRequestContext
Source§impl Error for MissingRequestContext
impl Error for MissingRequestContext
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl IntoResponse for MissingRequestContext
impl IntoResponse for MissingRequestContext
Source§fn into_response(self) -> Response
fn into_response(self) -> Response
Create a response.
Source§impl PartialEq for MissingRequestContext
impl PartialEq for MissingRequestContext
impl StructuralPartialEq for MissingRequestContext
Auto Trait Implementations§
impl Freeze for MissingRequestContext
impl RefUnwindSafe for MissingRequestContext
impl Send for MissingRequestContext
impl Sync for MissingRequestContext
impl Unpin for MissingRequestContext
impl UnsafeUnpin for MissingRequestContext
impl UnwindSafe for MissingRequestContext
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, S> Handler<IntoResponseHandler, S> for T
impl<T, S> Handler<IntoResponseHandler, S> for T
Source§fn call(
self,
_req: Request<Body>,
_state: S,
) -> <T as Handler<IntoResponseHandler, S>>::Future
fn call( self, _req: Request<Body>, _state: S, ) -> <T as Handler<IntoResponseHandler, S>>::Future
Call the handler with the given request.
Source§fn layer<L>(self, layer: L) -> Layered<L, Self, T, S>where
L: Layer<HandlerService<Self, T, S>> + Clone,
<L as Layer<HandlerService<Self, T, S>>>::Service: Service<Request<Body>>,
fn layer<L>(self, layer: L) -> Layered<L, Self, T, S>where
L: Layer<HandlerService<Self, T, S>> + Clone,
<L as Layer<HandlerService<Self, T, S>>>::Service: Service<Request<Body>>,
Apply a
tower::Layer to the handler. Read moreSource§fn with_state(self, state: S) -> HandlerService<Self, T, S>
fn with_state(self, state: S) -> HandlerService<Self, T, S>
Convert the handler into a
Service by providing the stateSource§impl<H, T> HandlerWithoutStateExt<T> for H
impl<H, T> HandlerWithoutStateExt<T> for H
Source§fn into_service(self) -> HandlerService<H, T, ()>
fn into_service(self) -> HandlerService<H, T, ()>
Convert the handler into a
Service and no state.Source§fn into_make_service(self) -> IntoMakeService<HandlerService<H, T, ()>>
fn into_make_service(self) -> IntoMakeService<HandlerService<H, T, ()>>
Convert the handler into a
MakeService and no state. Read moreSource§fn into_make_service_with_connect_info<C>(
self,
) -> IntoMakeServiceWithConnectInfo<HandlerService<H, T, ()>, C>
fn into_make_service_with_connect_info<C>( self, ) -> IntoMakeServiceWithConnectInfo<HandlerService<H, T, ()>, C>
Convert the handler into a
MakeService which stores information
about the incoming connection and has no state. Read more