Trait ServiceExt
pub trait ServiceExt<R>: Service<R> + Sized
Extension trait that adds additional methods to any Service.
Required Methods
fn into_make_service(self) -> IntoMakeService<Self>Convert this service into a
MakeService, that is aServicewhose response is another service.This is commonly used when applying middleware around an entire
Router. See "Rewriting request URI in middleware" for more details.fn into_make_service_with_connect_info<C>(self) -> IntoMakeServiceWithConnectInfo<Self, C>Convert this service into a
MakeService, that will storeC's associatedConnectInfoin a request extension such thatConnectInfocan extract it.This enables extracting things like the client's remote address. This is commonly used when applying middleware around an entire
Router. See "Rewriting request URI in middleware" for more details.
Provided Methods
fn handle_error<F, T>(self, f: F) -> HandleError<Self, F, T>Convert this service into a
HandleError, that will handle errors by converting them into responses.See "error handling model" for more details.
Implementors
impl<S, R> ServiceExt<R> for AddExtension<S, T> where S: Service<R>,impl<S, R> ServiceExt<R> for FromExtractor<T, E, S> where S: Service<R>,impl<S, R> ServiceExt<R> for FromFn<F, S, I, T> where S: Service<R>,impl<S, R> ServiceExt<R> for HandleError<S, F, T> where S: Service<R>,impl<S, R> ServiceExt<R> for HandlerService<H, T, S> where S: Service<R>,impl<S, R> ServiceExt<R> for IntoMakeService<S> where S: Service<R>,impl<S, R> ServiceExt<R> for IntoMakeServiceWithConnectInfo<S, C> where S: Service<R>,impl<S, R> ServiceExt<R> for MapRequest<F, S, I, T> where S: Service<R>,impl<S, R> ServiceExt<R> for MapResponse<F, S, I, T> where S: Service<R>,impl<S, R> ServiceExt<R> for MethodRouter<S, E> where S: Service<R>,impl<S, R> ServiceExt<R> for Next where S: Service<R>,impl<S, R> ServiceExt<R> for ResponseAxumBody<S> where S: Service<R>,impl<S, R> ServiceExt<R> for Route<E> where S: Service<R>,impl<S, R> ServiceExt<R> for Router<S> where S: Service<R>,impl<S, R> ServiceExt<R> for RouterAsService<'a, B, S> where S: Service<R>,impl<S, R> ServiceExt<R> for RouterIntoService<B, S> where S: Service<R>,impl<S, R> ServiceExt<R> for S where S: Service<R> + Sized,