Process response

This commit is contained in:
Carl Lerche
2017-06-27 01:34:37 -07:00
parent 7897b770e9
commit 1f85d54cff
8 changed files with 112 additions and 13 deletions

25
src/frame/reset.rs Normal file
View File

@@ -0,0 +1,25 @@
use frame::{Head, Error};
use super::{head, StreamId};
#[derive(Debug)]
pub struct Reset {
stream_id: StreamId,
error_code: u32,
}
impl Reset {
pub fn load(head: Head, payload: &[u8]) -> Result<Reset, Error> {
if payload.len() != 4 {
// Invalid payload len
// TODO: Handle error
unimplemented!();
}
let error_code = unpack_octets_4!(payload, 0, u32);
Ok(Reset {
stream_id: head.stream_id(),
error_code: error_code,
})
}
}