add SendResponse::poll_reset and SendStream::poll_reset to listen for reset streams (#279)
This commit is contained in:
16
src/share.rs
16
src/share.rs
@@ -319,6 +319,22 @@ impl<B: IntoBuf> SendStream<B> {
|
||||
pub fn send_reset(&mut self, reason: Reason) {
|
||||
self.inner.send_reset(reason)
|
||||
}
|
||||
|
||||
/// Polls to be notified when the client resets this stream.
|
||||
///
|
||||
/// If stream is still open, this returns `Ok(Async::NotReady)`, and
|
||||
/// registers the task to be notified if a `RST_STREAM` is received.
|
||||
///
|
||||
/// If a `RST_STREAM` frame is received for this stream, calling this
|
||||
/// method will yield the `Reason` for the reset.
|
||||
///
|
||||
/// # Error
|
||||
///
|
||||
/// If connection sees an error, this returns that error instead of a
|
||||
/// `Reason`.
|
||||
pub fn poll_reset(&mut self) -> Poll<Reason, ::Error> {
|
||||
self.inner.poll_reset(proto::PollReset::Streaming)
|
||||
}
|
||||
}
|
||||
|
||||
// ===== impl RecvStream =====
|
||||
|
||||
Reference in New Issue
Block a user