Progress towards allowing large writes

This commit is contained in:
Carl Lerche
2017-08-11 16:57:51 -07:00
parent 32d4c2d5a9
commit 8a15663ed2
14 changed files with 254 additions and 108 deletions

View File

@@ -52,9 +52,24 @@ impl<T> Data<T> {
&self.data
}
pub fn payload_mut(&mut self) -> &mut T {
&mut self.data
}
pub fn into_payload(self) -> T {
self.data
}
pub fn map<F, U>(self, f: F) -> Data<U>
where F: FnOnce(T) -> U,
{
Data {
stream_id: self.stream_id,
data: f(self.data),
flags: self.flags,
pad_len: self.pad_len,
}
}
}
impl<T: Buf> Data<T> {