diff --git a/h3-webtransport/src/server.rs b/h3-webtransport/src/server.rs index fd24ed4d..6a2cf780 100644 --- a/h3-webtransport/src/server.rs +++ b/h3-webtransport/src/server.rs @@ -269,6 +269,22 @@ pin_project! { } } +impl<'a, C: quic::Connection, B: Buf> OpenBi<'a, C, B> { + #[allow(missing_docs)] + pub fn new(opener: &'a Mutex, session_id: SessionId) -> Self { + Self { + opener, + stream: None, + session_id, + } + } + #[allow(missing_docs)] + pub fn with_stream(mut self, stream: impl Into>>) -> Self { + self.stream = stream.into(); + self + } +} + impl<'a, B, C> Future for OpenBi<'a, C, B> where C: quic::Connection, @@ -312,6 +328,21 @@ pin_project! { session_id: SessionId, } } +impl<'a, C: quic::Connection, B: Buf> OpenUni<'a, C, B> { + #[allow(missing_docs)] + pub fn new(opener: &'a Mutex, session_id: SessionId) -> Self { + Self { + opener, + stream: None, + session_id, + } + } + #[allow(missing_docs)] + pub fn with_stream(mut self, stream: impl Into>>) -> Self { + self.stream = stream.into(); + self + } +} impl<'a, C, B> Future for OpenUni<'a, C, B> where @@ -368,6 +399,19 @@ where conn: &'a Mutex>, _marker: PhantomData, } +impl<'a, C, B> ReadDatagram<'a, C, B> +where + C: quic::Connection, + B: Buf, +{ + #[allow(missing_docs)] + pub fn new(conn: &'a Mutex>) -> Self { + Self { + conn, + _marker: PhantomData, + } + } +} impl<'a, C, B> Future for ReadDatagram<'a, C, B> where @@ -400,6 +444,16 @@ where conn: &'a Mutex>, } +impl<'a, C, B> AcceptUni<'a, C, B> +where + C: quic::Connection, + B: Buf, +{ + #[allow(missing_docs)] + pub fn new(conn: &'a Mutex>) -> Self { + Self { conn } + } +} impl<'a, C, B> Future for AcceptUni<'a, C, B> where C: quic::Connection, diff --git a/h3-webtransport/src/stream.rs b/h3-webtransport/src/stream.rs index 4f29f6f5..b0ace0e1 100644 --- a/h3-webtransport/src/stream.rs +++ b/h3-webtransport/src/stream.rs @@ -91,7 +91,7 @@ impl std::fmt::Debug for SendStream { impl SendStream { #[allow(missing_docs)] - pub(crate) fn new(stream: BufRecvStream) -> Self { + pub fn new(stream: BufRecvStream) -> Self { Self { stream } } } @@ -210,7 +210,8 @@ pin_project! { } impl BidiStream { - pub(crate) fn new(stream: BufRecvStream) -> Self { + #[allow(missing_docs)] + pub fn new(stream: BufRecvStream) -> Self { Self { stream } } } diff --git a/h3/src/server.rs b/h3/src/server.rs index 3e220f1e..d64a3d9b 100644 --- a/h3/src/server.rs +++ b/h3/src/server.rs @@ -820,6 +820,20 @@ pin_project! { } } +impl<'a, C, B> ReadDatagram<'a, C, B> +where + C: quic::Connection, + B: Buf, +{ + #[allow(missing_docs)] + pub fn new(conn: &'a mut Connection) -> Self { + Self { + conn, + _marker: PhantomData, + } + } +} + impl<'a, C, B> Future for ReadDatagram<'a, C, B> where C: quic::Connection + RecvDatagramExt,