use hyper::service::Service; use std::{ future::{ready, Ready}, task::{Context, Poll}, }; pub struct MakeSvc { pub service: T, } impl Service for MakeSvc { type Response = V; type Error = std::io::Error; type Future = Ready>; fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { Ok(()).into() } fn call(&mut self, _: T) -> Self::Future { ready(Ok(self.service.clone())) } } impl MakeSvc { pub const fn new(service: T) -> Self { Self { service } } }