Refactor quic traits Connection
and OpenStreams
to use self: Pin<&mut Self>
instead of &mut self
#298
Labels
A-trait
Area: quic trait abstraction
C-performance
Category: performance. This is making existing behavior go faster.
C-refactor
Category: refactor. This would improve the clarity of internal code.
The current quic traits have
&mut self
in the function signature. For example: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
andOpenStreams
trait.This would allow quic implementations like h3-quinn to not require Boxing the streams.
h3/h3-quinn/src/lib.rs
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
andOpenStreams
which only have two methods not needingPin
, which isclose
andopener
.Either by defining a new separate trait for
close
andopener
or by maintaining a separate cloneable instance ofOpenStreams
which is not pinned.The text was updated successfully, but these errors were encountered: