Wire in recv flow control (#26)

This commit is contained in:
Carl Lerche
2017-08-23 11:22:24 -07:00
committed by GitHub
parent a623ab68b5
commit 807d2b7317
18 changed files with 452 additions and 345 deletions

View File

@@ -3,13 +3,20 @@ use frame::{self, Head, Error, Kind, StreamId};
use bytes::{BufMut, BigEndian};
#[derive(Debug)]
#[derive(Debug, Clone, Copy)]
pub struct GoAway {
last_stream_id: StreamId,
error_code: u32,
}
impl GoAway {
pub fn new(last_stream_id: StreamId, reason: Reason) -> Self {
GoAway {
last_stream_id,
error_code: reason.into(),
}
}
pub fn reason(&self) -> Reason {
self.error_code.into()
}