mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-27 00:00:12 +02:00
tokio-stream: implement FusedStream for Fuse (#8090)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
use crate::Stream;
|
||||
|
||||
use futures_core::FusedStream;
|
||||
use pin_project_lite::pin_project;
|
||||
use std::pin::Pin;
|
||||
use std::task::{ready, Context, Poll};
|
||||
@@ -51,3 +52,12 @@ where
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> FusedStream for Fuse<T>
|
||||
where
|
||||
T: Stream,
|
||||
{
|
||||
fn is_terminated(&self) -> bool {
|
||||
self.stream.is_none()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user