Remove Unpin requirement for the send Buf

This commit is contained in:
Sean McArthur
2019-12-06 11:26:36 -08:00
parent 13e0f17a03
commit ec751f3696
12 changed files with 34 additions and 33 deletions

View File

@@ -73,7 +73,7 @@ impl<T, P, B> Connection<T, P, B>
where
T: AsyncRead + AsyncWrite + Unpin,
P: Peer,
B: Buf + Unpin,
B: Buf,
{
pub fn new(codec: Codec<T, Prioritized<B>>, config: Config) -> Connection<T, P, B> {
let streams = Streams::new(streams::Config {
@@ -394,7 +394,7 @@ where
impl<T, B> Connection<T, server::Peer, B>
where
T: AsyncRead + AsyncWrite + Unpin,
B: Buf + Unpin,
B: Buf,
{
pub fn next_incoming(&mut self) -> Option<StreamRef<B>> {
self.streams.next_incoming()

View File

@@ -128,7 +128,7 @@ impl GoAway {
) -> Poll<Option<io::Result<Reason>>>
where
T: AsyncWrite + Unpin,
B: Buf + Unpin,
B: Buf,
{
if let Some(frame) = self.pending.take() {
if !dst.poll_ready(cx)?.is_ready() {

View File

@@ -142,7 +142,7 @@ impl PingPong {
) -> Poll<io::Result<()>>
where
T: AsyncWrite + Unpin,
B: Buf + Unpin,
B: Buf,
{
if let Some(pong) = self.pending_pong.take() {
if !dst.poll_ready(cx)?.is_ready() {
@@ -165,7 +165,7 @@ impl PingPong {
) -> Poll<io::Result<()>>
where
T: AsyncWrite + Unpin,
B: Buf + Unpin,
B: Buf,
{
if let Some(ref mut ping) = self.pending_ping {
if !ping.sent {

View File

@@ -43,8 +43,8 @@ impl Settings {
) -> Result<(), RecvError>
where
T: AsyncWrite + Unpin,
B: Buf + Unpin,
C: Buf + Unpin,
B: Buf,
C: Buf,
P: Peer,
{
if frame.is_ack() {
@@ -100,8 +100,8 @@ impl Settings {
) -> Poll<Result<(), RecvError>>
where
T: AsyncWrite + Unpin,
B: Buf + Unpin,
C: Buf + Unpin,
B: Buf,
C: Buf,
P: Peer,
{
if let Some(settings) = &self.remote {

View File

@@ -474,7 +474,7 @@ impl Prioritize {
) -> Poll<io::Result<()>>
where
T: AsyncWrite + Unpin,
B: Buf + Unpin,
B: Buf,
{
// Ensure codec is ready
ready!(dst.poll_ready(cx))?;

View File

@@ -846,7 +846,7 @@ impl Recv {
) -> Poll<io::Result<()>>
where
T: AsyncWrite + Unpin,
B: Buf + Unpin,
B: Buf,
{
if let Some(stream_id) = self.refused {
ready!(dst.poll_ready(cx))?;
@@ -918,7 +918,7 @@ impl Recv {
) -> Poll<io::Result<()>>
where
T: AsyncWrite + Unpin,
B: Buf + Unpin,
B: Buf,
{
// Send any pending connection level window updates
ready!(self.send_connection_window_update(cx, dst))?;
@@ -937,7 +937,7 @@ impl Recv {
) -> Poll<io::Result<()>>
where
T: AsyncWrite + Unpin,
B: Buf + Unpin,
B: Buf,
{
if let Some(incr) = self.flow.unclaimed_capacity() {
let frame = frame::WindowUpdate::new(StreamId::zero(), incr);
@@ -968,7 +968,7 @@ impl Recv {
) -> Poll<io::Result<()>>
where
T: AsyncWrite + Unpin,
B: Buf + Unpin,
B: Buf,
{
loop {
// Ensure the codec has capacity

View File

@@ -279,7 +279,7 @@ impl Send {
) -> Poll<io::Result<()>>
where
T: AsyncWrite + Unpin,
B: Buf + Unpin,
B: Buf,
{
self.prioritize
.poll_complete(cx, buffer, store, counts, dst)

View File

@@ -94,7 +94,7 @@ struct SendBuffer<B> {
impl<B, P> Streams<B, P>
where
B: Buf + Unpin,
B: Buf,
P: Peer,
{
pub fn new(config: Config) -> Self {
@@ -596,7 +596,6 @@ where
) -> Poll<io::Result<()>>
where
T: AsyncWrite + Unpin,
B: Unpin,
{
let mut me = self.inner.lock().unwrap();
let me = &mut *me;