From 17b46b8533d0d68d91972a6c33bd2d3d1530d064 Mon Sep 17 00:00:00 2001 From: Yaroslav Rosomakho Date: Wed, 15 Jan 2025 00:21:12 +0700 Subject: [PATCH] Client also needs an ability to stop streams with error code --- h3/src/client/stream.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/h3/src/client/stream.rs b/h3/src/client/stream.rs index ee5600b8..77263477 100644 --- a/h3/src/client/stream.rs +++ b/h3/src/client/stream.rs @@ -207,6 +207,13 @@ where self.inner.send_data(buf).await } + /// Stop a stream with an error code + /// + /// The code can be [`Code::H3_NO_ERROR`]. + pub fn stop_stream(&mut self, error_code: Code) { + self.inner.stop_stream(error_code); + } + /// Send a set of trailers to end the request. /// /// [`RequestStream::finish()`] must be called to finalize a request.