dem/netmsg_doer/stuff_text.rs
1use super::*;
2
3impl Doer for SvcStuffText {
4 fn id(&self) -> u8 {
5 9
6 }
7
8 fn parse(i: &[u8], _: AuxRefCell) -> Result<Self> {
9 map(null_string, |command| SvcStuffText {
10 command: command.into(),
11 })(i)
12 }
13
14 fn write(&self, _: AuxRefCell) -> ByteVec {
15 let mut writer = ByteWriter::new();
16
17 writer.append_u8(self.id());
18
19 writer.append_u8_slice(self.command.as_slice());
20
21 writer.data
22 }
23}