-
Notifications
You must be signed in to change notification settings - Fork 111
Description
The current quic traits have &mut self in the function signature. For example:
fn poll_accept_recv(
&mut self,
cx: &mut task::Context<'_>,
) -> Poll<Result<Self::RecvStream, ConnectionErrorIncoming>>;In the original proposal some of the trait methods had self: Pin<&mut Self> instead.
https://github.com/hyperium/h3/blob/master/docs/PROPOSAL.md#connections
It would take a large refactor to chance it now, but i think it is possible for the Connection and OpenStreams trait.
This would allow quic implementations like h3-quinn to not require Boxing the streams.
Lines 45 to 48 in bf078de
| incoming_bi: BoxStreamSync<'static, <AcceptBi<'static> as Future>::Output>, | |
| opening_bi: Option<BoxStreamSync<'static, <OpenBi<'static> as Future>::Output>>, | |
| incoming_uni: BoxStreamSync<'static, <AcceptUni<'static> as Future>::Output>, | |
| opening_uni: Option<BoxStreamSync<'static, <OpenUni<'static> as Future>::Output>>, |
What do you think, is it worth the time?
With a little digging and found this comment.
#3 (comment)
This comment refes to the RecvStream trait.
The problem mentioned in the comment can be worked around for Connection and OpenStreams which only have two methods not needing Pin , which is close and opener.
Either by defining a new separate trait for close and opener or by maintaining a separate cloneable instance of OpenStreams which is not pinned.