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:
@@ -758,6 +758,15 @@ impl OpaqueStreamRef {
|
||||
me.actions.recv.body_is_empty(&stream)
|
||||
}
|
||||
|
||||
pub fn is_end_stream(&self) -> bool {
|
||||
let mut me = self.inner.lock().unwrap();
|
||||
let me = &mut *me;
|
||||
|
||||
let stream = me.store.resolve(self.key);
|
||||
|
||||
me.actions.recv.is_end_stream(&stream)
|
||||
}
|
||||
|
||||
pub fn poll_data(&mut self) -> Poll<Option<Bytes>, proto::Error> {
|
||||
let mut me = self.inner.lock().unwrap();
|
||||
let me = &mut *me;
|
||||
|
||||
Reference in New Issue
Block a user