viz_core/handler/
into_handler.rsuse crate::{handler::FnExtHandler, FnExt, FromRequest, Handler, IntoResponse, Result};
pub trait IntoHandler<I, E> {
type Handler: Handler<I>;
#[must_use]
fn into_handler(self) -> Self::Handler;
}
impl<I, H, E, O> IntoHandler<I, E> for H
where
I: Send + 'static,
E: FromRequest + 'static,
E::Error: IntoResponse,
H: FnExt<I, E, Output = Result<O>>,
O: 'static,
{
type Handler = FnExtHandler<H, E, O>;
fn into_handler(self) -> Self::Handler {
FnExtHandler::new(self)
}
}