1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use crate::codec::{Codec, StdError, WithOffset, WithSize};

#[derive(Clone, Copy, Debug, PartialEq)]
pub struct ResponseTag {
    /// End of packet
    ///
    /// Signal the last response packet for the request `id`
    /// (E)
    pub eop: bool,
    /// An error occured
    /// (R)
    pub err: bool,
    pub id: u8,
}
impl std::fmt::Display for ResponseTag {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        write!(
            f,
            "[{}{}]({})",
            if self.eop { "E" } else { "-" },
            if self.err { "R" } else { "-" },
            self.id,
        )
    }
}
super::impl_simple_op!(ResponseTag, eop, err, id);