mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-26 00:00:16 +02:00
time: implement FusedStream for IntervalStream (#7854)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
use crate::Stream;
|
||||
use futures_core::stream::FusedStream;
|
||||
use std::pin::Pin;
|
||||
use std::task::{Context, Poll};
|
||||
use tokio::time::{Instant, Interval};
|
||||
@@ -57,6 +58,12 @@ impl Stream for IntervalStream {
|
||||
}
|
||||
}
|
||||
|
||||
impl FusedStream for IntervalStream {
|
||||
fn is_terminated(&self) -> bool {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
impl AsRef<Interval> for IntervalStream {
|
||||
fn as_ref(&self) -> &Interval {
|
||||
&self.inner
|
||||
|
||||
Reference in New Issue
Block a user