h3_util/
server.rs

1use hyper::body::Bytes;
2//use std::future::Future;
3
4//use crate::server_body::H3IncomingServer;
5
6pub trait H3Acceptor {
7    type CONN: h3::quic::Connection<
8            Bytes,
9            OpenStreams = Self::OS,
10            SendStream = Self::SS,
11            RecvStream = Self::RS,
12            BidiStream = Self::BS,
13        > + Send
14        + 'static;
15    type OS: h3::quic::OpenStreams<Bytes, BidiStream = Self::BS> + Clone + Send; // Clone is needed for cloning send_request
16    type SS: h3::quic::SendStream<Bytes> + Send;
17    type RS: h3::quic::RecvStream + Send + 'static;
18    type BS: h3::quic::BidiStream<Bytes, RecvStream = Self::RS, SendStream = Self::SS>
19        + Send
20        + 'static;
21
22    fn accept(
23        &mut self,
24    ) -> impl std::future::Future<Output = Result<Option<Self::CONN>, crate::Error>> + std::marker::Send;
25}