Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
fafhrd91 committed Sep 10, 2024
1 parent f279962 commit fb55ce9
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions ntex-glommio/src/io.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
use std::task::{Context, Poll};
use std::{any, future::poll_fn, future::Future, io, pin::Pin};
use std::{any, future::poll_fn, io, pin::Pin, task::ready, task::Context, task::Poll};

use futures_lite::future::FutureExt;
use futures_lite::io::{AsyncRead, AsyncWrite};
use ntex_bytes::{Buf, BufMut, BytesVec};
use ntex_io::{types, Handle, IoStream, ReadContext, WriteContext, WriteStatus};
use ntex_util::{ready, time::sleep, time::Sleep};
use ntex_io::{types, Handle, IoStream, ReadContext, WriteContext};
use ntex_util::future::lazy;

use crate::net_impl::{TcpStream, UnixStream};

Expand Down Expand Up @@ -63,7 +61,7 @@ struct Write(TcpStream);
impl ntex_io::AsyncWrite for Write {
#[inline]
async fn write(&mut self, mut buf: BytesVec) -> (BytesVec, io::Result<()>) {
match lazy(|cx| flush_io(&mut *self.0.borrow_mut(), &mut buf, cx)).await {
match lazy(|cx| flush_io(&mut self.0, &mut buf, cx)).await {

Check failure on line 64 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / Clippy

the trait bound `net_impl::TcpStream: futures_lite::AsyncRead` is not satisfied

Check failure on line 64 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / Clippy

the trait bound `net_impl::TcpStream: futures_lite::AsyncWrite` is not satisfied

Check failure on line 64 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / Clippy

the trait bound `net_impl::TcpStream: futures_lite::AsyncRead` is not satisfied

Check failure on line 64 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / Clippy

the trait bound `net_impl::TcpStream: futures_lite::AsyncWrite` is not satisfied

Check failure on line 64 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / stable - x86_64-unknown-linux-gnu

the trait bound `net_impl::TcpStream: futures_lite::AsyncRead` is not satisfied

Check failure on line 64 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / stable - x86_64-unknown-linux-gnu

the trait bound `net_impl::TcpStream: futures_lite::AsyncWrite` is not satisfied

Check failure on line 64 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / coverage

the trait bound `net_impl::TcpStream: futures_lite::AsyncRead` is not satisfied

Check failure on line 64 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / coverage

the trait bound `net_impl::TcpStream: futures_lite::AsyncWrite` is not satisfied

Check failure on line 64 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / coverage

the trait bound `net_impl::TcpStream: futures_lite::AsyncRead` is not satisfied

Check failure on line 64 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / coverage

the trait bound `net_impl::TcpStream: futures_lite::AsyncWrite` is not satisfied

Check failure on line 64 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / 1.75.0 - x86_64-unknown-linux-gnu

the trait bound `net_impl::TcpStream: futures_lite::AsyncRead` is not satisfied

Check failure on line 64 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / 1.75.0 - x86_64-unknown-linux-gnu

the trait bound `net_impl::TcpStream: futures_lite::AsyncWrite` is not satisfied

Check failure on line 64 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / coverage

the trait bound `net_impl::TcpStream: futures_lite::AsyncRead` is not satisfied

Check failure on line 64 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / coverage

the trait bound `net_impl::TcpStream: futures_lite::AsyncWrite` is not satisfied

Check failure on line 64 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / coverage

the trait bound `net_impl::TcpStream: futures_lite::AsyncRead` is not satisfied

Check failure on line 64 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / coverage

the trait bound `net_impl::TcpStream: futures_lite::AsyncWrite` is not satisfied

Check failure on line 64 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / nightly - x86_64-unknown-linux-gnu

the trait bound `net_impl::TcpStream: futures_lite::AsyncRead` is not satisfied

Check failure on line 64 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / nightly - x86_64-unknown-linux-gnu

the trait bound `net_impl::TcpStream: futures_lite::AsyncWrite` is not satisfied

Check failure on line 64 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / nightly - x86_64-unknown-linux-gnu

the trait bound `net_impl::TcpStream: futures_lite::AsyncRead` is not satisfied

Check failure on line 64 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / nightly - x86_64-unknown-linux-gnu

the trait bound `net_impl::TcpStream: futures_lite::AsyncWrite` is not satisfied

Check failure on line 64 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / 1.75.0 - x86_64-unknown-linux-gnu

the trait bound `net_impl::TcpStream: futures_lite::AsyncRead` is not satisfied

Check failure on line 64 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / 1.75.0 - x86_64-unknown-linux-gnu

the trait bound `net_impl::TcpStream: futures_lite::AsyncWrite` is not satisfied
Poll::Ready(res) => (buf, res),
Poll::Pending => (buf, Ok(())),
}
Expand All @@ -76,7 +74,7 @@ impl ntex_io::AsyncWrite for Write {

#[inline]
async fn shutdown(&mut self) -> io::Result<()> {
poll_fn(|cx| Pin::new(&mut *self.0.borrow_mut()).poll_close(cx)).await
poll_fn(|cx| Pin::new(&mut self.0).poll_close(cx)).await

Check failure on line 77 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / Clippy

no method named `poll_close` found for struct `std::pin::Pin<&mut net_impl::TcpStream>` in the current scope

Check failure on line 77 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / Clippy

no method named `poll_close` found for struct `std::pin::Pin<&mut net_impl::TcpStream>` in the current scope

Check failure on line 77 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / stable - x86_64-unknown-linux-gnu

no method named `poll_close` found for struct `Pin<&mut net_impl::TcpStream>` in the current scope

Check failure on line 77 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / coverage

no method named `poll_close` found for struct `Pin<&mut net_impl::TcpStream>` in the current scope

Check failure on line 77 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / coverage

no method named `poll_close` found for struct `Pin<&mut net_impl::TcpStream>` in the current scope

Check failure on line 77 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / 1.75.0 - x86_64-unknown-linux-gnu

no method named `poll_close` found for struct `Pin<&mut net_impl::TcpStream>` in the current scope

Check failure on line 77 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / coverage

no method named `poll_close` found for struct `Pin<&mut net_impl::TcpStream>` in the current scope

Check failure on line 77 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / coverage

no method named `poll_close` found for struct `Pin<&mut net_impl::TcpStream>` in the current scope

Check failure on line 77 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / nightly - x86_64-unknown-linux-gnu

no method named `poll_close` found for struct `Pin<&mut net_impl::TcpStream>` in the current scope

Check failure on line 77 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / nightly - x86_64-unknown-linux-gnu

no method named `poll_close` found for struct `Pin<&mut net_impl::TcpStream>` in the current scope

Check failure on line 77 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / 1.75.0 - x86_64-unknown-linux-gnu

no method named `poll_close` found for struct `Pin<&mut net_impl::TcpStream>` in the current scope
}
}

Expand Down Expand Up @@ -178,7 +176,7 @@ struct UnixWrite(UnixStream);
impl ntex_io::AsyncWrite for UnixWrite {
#[inline]
async fn write(&mut self, mut buf: BytesVec) -> (BytesVec, io::Result<()>) {
match lazy(|cx| flush_io(&mut *self.0.borrow_mut(), &mut buf, cx)).await {
match lazy(|cx| flush_io(&mut self.0, &mut buf, cx)).await {

Check failure on line 179 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / Clippy

the trait bound `net_impl::UnixStream: futures_lite::AsyncRead` is not satisfied

Check failure on line 179 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / Clippy

the trait bound `net_impl::UnixStream: futures_lite::AsyncWrite` is not satisfied

Check failure on line 179 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / Clippy

the trait bound `net_impl::UnixStream: futures_lite::AsyncRead` is not satisfied

Check failure on line 179 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / Clippy

the trait bound `net_impl::UnixStream: futures_lite::AsyncWrite` is not satisfied

Check failure on line 179 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / stable - x86_64-unknown-linux-gnu

the trait bound `net_impl::UnixStream: futures_lite::AsyncRead` is not satisfied

Check failure on line 179 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / stable - x86_64-unknown-linux-gnu

the trait bound `net_impl::UnixStream: futures_lite::AsyncWrite` is not satisfied

Check failure on line 179 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / coverage

the trait bound `net_impl::UnixStream: futures_lite::AsyncRead` is not satisfied

Check failure on line 179 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / coverage

the trait bound `net_impl::UnixStream: futures_lite::AsyncWrite` is not satisfied

Check failure on line 179 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / coverage

the trait bound `net_impl::UnixStream: futures_lite::AsyncRead` is not satisfied

Check failure on line 179 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / coverage

the trait bound `net_impl::UnixStream: futures_lite::AsyncWrite` is not satisfied

Check failure on line 179 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / 1.75.0 - x86_64-unknown-linux-gnu

the trait bound `net_impl::UnixStream: futures_lite::AsyncRead` is not satisfied

Check failure on line 179 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / 1.75.0 - x86_64-unknown-linux-gnu

the trait bound `net_impl::UnixStream: futures_lite::AsyncWrite` is not satisfied

Check failure on line 179 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / coverage

the trait bound `net_impl::UnixStream: futures_lite::AsyncRead` is not satisfied

Check failure on line 179 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / coverage

the trait bound `net_impl::UnixStream: futures_lite::AsyncWrite` is not satisfied

Check failure on line 179 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / coverage

the trait bound `net_impl::UnixStream: futures_lite::AsyncRead` is not satisfied

Check failure on line 179 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / coverage

the trait bound `net_impl::UnixStream: futures_lite::AsyncWrite` is not satisfied

Check failure on line 179 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / nightly - x86_64-unknown-linux-gnu

the trait bound `net_impl::UnixStream: futures_lite::AsyncRead` is not satisfied

Check failure on line 179 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / nightly - x86_64-unknown-linux-gnu

the trait bound `net_impl::UnixStream: futures_lite::AsyncWrite` is not satisfied

Check failure on line 179 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / nightly - x86_64-unknown-linux-gnu

the trait bound `net_impl::UnixStream: futures_lite::AsyncRead` is not satisfied

Check failure on line 179 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / nightly - x86_64-unknown-linux-gnu

the trait bound `net_impl::UnixStream: futures_lite::AsyncWrite` is not satisfied

Check failure on line 179 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / 1.75.0 - x86_64-unknown-linux-gnu

the trait bound `net_impl::UnixStream: futures_lite::AsyncRead` is not satisfied

Check failure on line 179 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / 1.75.0 - x86_64-unknown-linux-gnu

the trait bound `net_impl::UnixStream: futures_lite::AsyncWrite` is not satisfied
Poll::Ready(res) => (buf, res),
Poll::Pending => (buf, Ok(())),
}
Expand All @@ -191,6 +189,6 @@ impl ntex_io::AsyncWrite for UnixWrite {

#[inline]
async fn shutdown(&mut self) -> io::Result<()> {
poll_fn(|cx| Pin::new(&mut *self.0.borrow_mut()).poll_close(cx)).await
poll_fn(|cx| Pin::new(&mut self.0).poll_close(cx)).await

Check failure on line 192 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / Clippy

no method named `poll_close` found for struct `std::pin::Pin<&mut net_impl::UnixStream>` in the current scope

Check failure on line 192 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / Clippy

no method named `poll_close` found for struct `std::pin::Pin<&mut net_impl::UnixStream>` in the current scope

Check failure on line 192 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / stable - x86_64-unknown-linux-gnu

no method named `poll_close` found for struct `Pin<&mut net_impl::UnixStream>` in the current scope

Check failure on line 192 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / coverage

no method named `poll_close` found for struct `Pin<&mut net_impl::UnixStream>` in the current scope

Check failure on line 192 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / coverage

no method named `poll_close` found for struct `Pin<&mut net_impl::UnixStream>` in the current scope

Check failure on line 192 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / 1.75.0 - x86_64-unknown-linux-gnu

no method named `poll_close` found for struct `Pin<&mut net_impl::UnixStream>` in the current scope

Check failure on line 192 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / coverage

no method named `poll_close` found for struct `Pin<&mut net_impl::UnixStream>` in the current scope

Check failure on line 192 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / coverage

no method named `poll_close` found for struct `Pin<&mut net_impl::UnixStream>` in the current scope

Check failure on line 192 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / nightly - x86_64-unknown-linux-gnu

no method named `poll_close` found for struct `Pin<&mut net_impl::UnixStream>` in the current scope

Check failure on line 192 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / nightly - x86_64-unknown-linux-gnu

no method named `poll_close` found for struct `Pin<&mut net_impl::UnixStream>` in the current scope

Check failure on line 192 in ntex-glommio/src/io.rs

View workflow job for this annotation

GitHub Actions / 1.75.0 - x86_64-unknown-linux-gnu

no method named `poll_close` found for struct `Pin<&mut net_impl::UnixStream>` in the current scope
}
}

0 comments on commit fb55ce9

Please sign in to comment.