Remove Unpin requirement for the send Buf
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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))?;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user