Work
This commit is contained in:
		| @@ -1,5 +1,5 @@ | ||||
| use frame::Head; | ||||
| use bytes::Bytes; | ||||
| use frame::{Head, Error}; | ||||
| use bytes::{Bytes, BytesMut, BufMut}; | ||||
|  | ||||
| #[derive(Debug, Clone, PartialEq, Eq)] | ||||
| pub struct Unknown { | ||||
| @@ -14,4 +14,14 @@ impl Unknown { | ||||
|             payload: payload, | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     pub fn encode_len(&self) -> usize { | ||||
|         self.head.encode_len() + self.payload.len() | ||||
|     } | ||||
|  | ||||
|     pub fn encode(&self, dst: &mut BytesMut) -> Result<(), Error> { | ||||
|         try!(self.head.encode(self.payload.len(), dst)); | ||||
|         dst.put(&self.payload); | ||||
|         Ok(()) | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user