1pub use self::h2_client::Http2ClientConnExec;
7
8mod h2_client {
9 use std::future::Future;
10
11 use tokio::io::{AsyncRead, AsyncWrite};
12
13 use crate::{error::BoxError, proto::http2::client::H2ClientFuture, rt::Executor};
14
15 pub trait Http2ClientConnExec<B, T>: sealed_client::Sealed<(B, T)>
22 where
23 B: http_body::Body,
24 B::Error: Into<BoxError>,
25 T: AsyncRead + AsyncWrite + Unpin,
26 {
27 #[doc(hidden)]
28 fn execute_h2_future(&mut self, future: H2ClientFuture<B, T>);
29 }
30
31 impl<E, B, T> Http2ClientConnExec<B, T> for E
32 where
33 E: Executor<H2ClientFuture<B, T>>,
34 B: http_body::Body + 'static,
35 B::Error: Into<BoxError>,
36 H2ClientFuture<B, T>: Future<Output = ()>,
37 T: AsyncRead + AsyncWrite + Unpin,
38 {
39 #[inline]
40 fn execute_h2_future(&mut self, future: H2ClientFuture<B, T>) {
41 self.execute(future)
42 }
43 }
44
45 impl<E, B, T> sealed_client::Sealed<(B, T)> for E
46 where
47 E: Executor<H2ClientFuture<B, T>>,
48 B: http_body::Body + 'static,
49 B::Error: Into<BoxError>,
50 H2ClientFuture<B, T>: Future<Output = ()>,
51 T: AsyncRead + AsyncWrite + Unpin,
52 {
53 }
54
55 mod sealed_client {
56 pub trait Sealed<X> {}
57 }
58}