axum::handler

Trait HandlerWithoutStateExt

Source
pub trait HandlerWithoutStateExt<T>: Handler<T, ()> {
    // Required methods
    fn into_service(self) -> HandlerService<Self, T, ()>;
    fn into_make_service(self) -> IntoMakeService<HandlerService<Self, T, ()>>;
}
Expand description

Extension trait for Handlers that don’t have state.

This provides convenience methods to convert the Handler into a Service or MakeService.

Required Methods§

Source

fn into_service(self) -> HandlerService<Self, T, ()>

Convert the handler into a Service and no state.

Source

fn into_make_service(self) -> IntoMakeService<HandlerService<Self, T, ()>>

Convert the handler into a MakeService and no state.

See HandlerService::into_make_service for more details.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<H, T> HandlerWithoutStateExt<T> for H
where H: Handler<T, ()>,