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
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.