Create H3 connecting from quic
@@ -8,7 +8,7 @@ use std::{
use futures::{ready, Stream};
use http::{response, Request, Response};
-use quinn::{CertificateChain, EndpointBuilder, PrivateKey, RecvStream, SendStream};
+use quinn::{self, CertificateChain, EndpointBuilder, PrivateKey, RecvStream, SendStream};
use quinn_proto::{Side, StreamId};
use rustls::TLSError;
@@ -164,6 +164,24 @@ impl Future for Connecting {
}
}
+impl From<quinn::Connecting> for Connecting {
+ fn from(connecting: quinn::Connecting) -> Self {
+ Self {
+ connecting,
+ settings: Settings::default(),
+ }
+ }
+}
+
+impl Connecting {
+ pub fn from_quic(connecting: quinn::Connecting, settings: Settings) -> Self {
+ Self {
+ connecting,
+ settings,
+ }
+ }
+}
+
pub struct IncomingRequest(ConnectionRef);
impl Stream for IncomingRequest {
