diff --git a/quinn-proto/src/connection/mod.rs b/quinn-proto/src/connection/mod.rs
index 6d20d21ae..c90d9b4b9 100644
--- a/quinn-proto/src/connection/mod.rs
+++ b/quinn-proto/src/connection/mod.rs
@@ -81,8 +81,8 @@ pub use streams::StreamsState;
#[cfg(not(fuzzing))]
use streams::StreamsState;
pub use streams::{
- BytesSource, Chunks, FinishError, ReadError, ReadableError, RecvStream, SendStream,
- StreamEvent, Streams, UnknownStream, WriteError, Written,
+ BytesSource, Chunks, ClosedStream, FinishError, ReadError, ReadableError, RecvStream,
+ SendStream, StreamEvent, Streams, WriteError, Written,
};
mod timer;
diff --git a/quinn-proto/src/connection/streams/mod.rs b/quinn-proto/src/connection/streams/mod.rs
index e5728c751..d2edf80e9 100644
--- a/quinn-proto/src/connection/streams/mod.rs
+++ b/quinn-proto/src/connection/streams/mod.rs
@@ -126,11 +126,11 @@ impl<'a> RecvStream<'a> {
/// Stop accepting data on the given receive stream
///
/// Discards unread data and notifies the peer to stop transmitting. Once stopped, further
- /// attempts to operate on a stream will yield `UnknownStream` errors.
- pub fn stop(&mut self, error_code: VarInt) -> Result<(), UnknownStream> {
+ /// attempts to operate on a stream will yield `ClosedStream` errors.
+ pub fn stop(&mut self, error_code: VarInt) -> Result<(), ClosedStream> {
let mut entry = match self.state.recv.entry(self.id) {
hash_map::Entry::Occupied(s) => s,
- hash_map::Entry::Vacant(_) => return Err(UnknownStream { _private: () }),
+ hash_map::Entry::Vacant(_) => return Err(ClosedStream { _private: () }),
};
let stream = get_or_insert_recv(self.state.stream_receive_window)(entry.get_mut());
@@ -214,7 +214,7 @@ impl<'a> SendStream<'a> {
.send
.get_mut(&self.id)
.map(get_or_insert_send(max_send_data))
- .ok_or(WriteError::UnknownStream)?;
+ .ok_or(WriteError::ClosedStream)?;
if limit == 0 {
trace!(
@@ -240,11 +240,11 @@ impl<'a> SendStream<'a> {
}
/// Check if this stream was stopped, get the reason if it was
- pub fn stopped(&mut self) -> Result