Add RecvStream::is_end_stream. (#165)
This function returns true if the `RecvStream` has reached an end of stream state. This is intended to replace `is_empty` which has confusing behavior.
This commit is contained in:
@@ -330,6 +330,16 @@ impl Recv {
|
||||
.unwrap_or(true)
|
||||
}
|
||||
|
||||
pub fn is_end_stream(&self, stream: &store::Ptr) -> bool {
|
||||
if !stream.state.is_recv_closed() {
|
||||
return false;
|
||||
}
|
||||
|
||||
stream
|
||||
.pending_recv
|
||||
.is_empty()
|
||||
}
|
||||
|
||||
pub fn recv_data(
|
||||
&mut self,
|
||||
frame: frame::Data,
|
||||
|
||||
Reference in New Issue
Block a user