1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-06-26 19:47:43 +02:00

remove pin-project; update Unpin consrtaint

This commit is contained in:
Nikolay Kim
2019-11-18 18:28:54 +06:00
parent 7404d82a9b
commit 1354946460
22 changed files with 225 additions and 161 deletions

View File

@ -225,6 +225,15 @@ impl<T, U> Framed<T, U> {
self.inner.get_mut().force_send(item)
}
pub fn is_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), U::Error>>
where
T: AsyncWrite + Unpin,
U: Encoder + Unpin,
U::Error: From<io::Error>,
{
Pin::new(&mut self.inner.get_mut()).poll_ready(cx)
}
pub fn next_item(&mut self, cx: &mut Context<'_>) -> Poll<Option<Result<U::Item, U::Error>>>
where
T: AsyncRead + Unpin,
@ -240,6 +249,14 @@ impl<T, U> Framed<T, U> {
{
Pin::new(self.inner.get_mut()).poll_flush(cx)
}
pub fn close(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), U::Error>>
where
T: AsyncWrite + Unpin,
U: Encoder + Unpin,
{
Pin::new(&mut self.inner.get_mut()).poll_close(cx)
}
}
impl<T, U> Stream for Framed<T, U>