We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ab593bb commit e43030dCopy full SHA for e43030d
axum/src/extract/ws.rs
@@ -94,7 +94,7 @@ use self::rejection::*;
94
use super::FromRequestParts;
95
use crate::{body::Bytes, response::Response, Error};
96
use axum_core::body::Body;
97
-use futures_core::Stream;
+use futures_core::{FusedStream, Stream};
98
use futures_sink::Sink;
99
use futures_util::{sink::SinkExt, stream::StreamExt};
100
use http::{
@@ -530,6 +530,13 @@ impl WebSocket {
530
}
531
532
533
+impl FusedStream for WebSocket {
534
+ /// Returns true if the websocket has been terminated.
535
+ fn is_terminated(&self) -> bool {
536
+ self.inner.is_terminated()
537
+ }
538
+}
539
+
540
impl Stream for WebSocket {
541
type Item = Result<Message, Error>;
542
0 commit comments