time: implement FusedStream for IntervalStream (#7854)

This commit is contained in:
Finn Sheng
2026-01-14 14:49:03 +01:00
committed by GitHub
parent 240cc44da8
commit b88c02c55e
2 changed files with 19 additions and 0 deletions
+7
View File
@@ -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