diff --git a/src/client.rs b/src/client.rs index 6d2b9690..86fef1ec 100644 --- a/src/client.rs +++ b/src/client.rs @@ -548,6 +548,16 @@ where pub fn is_extended_connect_protocol_enabled(&self) -> bool { self.inner.is_extended_connect_protocol_enabled() } + + /// Returns the current max send streams + pub fn current_max_send_streams(&self) -> usize { + self.inner.current_max_send_streams() + } + + /// Returns the current max recv streams + pub fn current_max_recv_streams(&self) -> usize { + self.inner.current_max_recv_streams() + } } impl fmt::Debug for SendRequest diff --git a/src/proto/streams/streams.rs b/src/proto/streams/streams.rs index fa8e6843..e6c9ed8a 100644 --- a/src/proto/streams/streams.rs +++ b/src/proto/streams/streams.rs @@ -320,6 +320,16 @@ where .send .is_extended_connect_protocol_enabled() } + + pub fn current_max_send_streams(&self) -> usize { + let me = self.inner.lock().unwrap(); + me.counts.max_send_streams() + } + + pub fn current_max_recv_streams(&self) -> usize { + let me = self.inner.lock().unwrap(); + me.counts.max_recv_streams() + } } impl DynStreams<'_, B> {