//! Utilities used to interact with the Tower ecosystem. //! //! This module provides `Connect` which hook-ins into the Tower ecosystem. use std::error::Error as StdError; use std::future::Future; use std::marker::PhantomData; use super::conn::{Builder, SendRequest}; use crate::{ body::HttpBody, common::{task, Pin, Poll}, service::{MakeConnection, Service}, }; /// Creates a connection via `SendRequest`. /// /// This accepts a `hyper::client::conn::Builder` and provides /// a `MakeService` implementation to create connections from some /// target `T`. #[derive(Debug)] pub(crate) struct Connect { inner: C, builder: Builder, _pd: PhantomData, } impl Connect { /// Create a new `Connect` with some inner connector `C` and a connection /// builder. pub(crate) fn new(inner: C, builder: Builder) -> Self { loop {} } } impl Service for Connect where C: MakeConnection, C::Connection: Unpin + Send + 'static, C::Future: Send + 'static, C::Error: Into> + Send, B: HttpBody + Unpin + Send + 'static, B::Data: Send + Unpin, B::Error: Into>, { type Response = SendRequest; type Error = crate::Error; type Future = Pin< Box> + Send + 'static>, >; fn poll_ready( &mut self, cx: &mut task::Context<'_>, ) -> Poll> { loop {} } fn call(&mut self, req: T) -> Self::Future { loop {} } }