Skip to content

Commit

Permalink
docs(quinn): Revise SendStream.stopped docs comment
Browse files Browse the repository at this point in the history
  • Loading branch information
gretchenfrage committed Jul 1, 2024
1 parent 2785e37 commit 62e1db0
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions quinn/src/send_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,16 @@ impl SendStream {
conn.inner.send_stream(self.stream).priority()
}

/// Completes when the stream is stopped or read to completion by the peer
/// Completes when the peer stops the stream or reads the stream to completion
///
/// Yields `Some` with the stop error code when the stream is stopped by the peer. Yields `None`
/// when the stream is [`finish()`](Self::finish)ed locally and all stream data has been
/// received (but not necessarily processed) by the peer, after which it is no longer meaningful
/// for the stream to be stopped.
/// Yields `Some` with the stop error code if the peer stops the stream. Yields `None` if the
/// local side [`finish()`](Self::finish)es the stream and then the peer acknowledges receipt
/// of all stream data (although not necessarily the processing of it), after which the peer
/// closing the stream is no longer meaningful.
///
/// For a variety of reasons, the peer may not send acknowledgements immediately upon receiving
/// data. As such, relying on `stopped` to know when the peer has read a stream to completion
/// may introduce more latency than using an application-level response of some sort.
pub async fn stopped(&mut self) -> Result<Option<VarInt>, StoppedError> {
Stopped { stream: self }.await
}
Expand Down

0 comments on commit 62e1db0

Please sign in to comment.