wip: stream state management seems good, but tests fail

This commit is contained in:
Oliver Gould
2017-07-22 17:30:40 +00:00
parent d7042097c4
commit ab4f85ea2f
9 changed files with 445 additions and 292 deletions

View File

@@ -66,6 +66,22 @@ pub enum Frame<T = Bytes> {
}
impl<T> Frame<T> {
pub fn is_connection_frame(&self) -> bool {
use self::Frame::*;
match self {
&Headers(..) |
&Data(..) |
&PushPromise(..) |
&Reset(..) => false,
&WindowUpdate(ref v) => v.stream_id().is_zero(),
&Ping(_) |
&Settings(_) => true,
}
}
pub fn stream_id(&self) -> StreamId {
use self::Frame::*;