(&mut self, line: T, buf: &mut BytesMut)
| 57 | { |
| 58 | type Error = Error; |
| 59 | fn encode(&mut self, line: T, buf: &mut BytesMut) -> Result<(), Self::Error> { |
| 60 | let line = line.as_ref(); |
| 61 | buf.reserve(line.len() + 2); |
| 62 | buf.put(line.as_bytes()); |
| 63 | buf.put_u8(b'\n'); |
| 64 | buf.put_u8(b'\n'); |
| 65 | Ok(()) |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | #[derive(Default)] |