diff --git a/src/proto/connection.rs b/src/proto/connection.rs index 5589fabc..f7fc8fcb 100644 --- a/src/proto/connection.rs +++ b/src/proto/connection.rs @@ -242,6 +242,11 @@ where } } + /// Checks if there are any streams + pub fn has_streams(&self) -> bool { + self.inner.streams.has_streams() + } + /// Checks if there are any streams or references left pub fn has_streams_or_other_references(&self) -> bool { // If we poll() and realize that there are no streams or references diff --git a/src/server.rs b/src/server.rs index b00bc086..144da0ff 100644 --- a/src/server.rs +++ b/src/server.rs @@ -553,6 +553,11 @@ where self.connection.take_user_pings().map(PingPong::new) } + /// Checks if there are any streams + pub fn has_streams(&self) -> bool { + self.connection.has_streams() + } + /// Returns the maximum number of concurrent streams that may be initiated /// by the server on this connection. ///