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
27
28
29
30
31
32
33
34
35
36
use std::io::Cursor;

use crate::error;
use crate::frame::{FromCursor, Serialize};

#[derive(Debug, PartialEq, Default, Ord, PartialOrd, Eq, Hash)]
pub struct BodyResReady;

impl Serialize for BodyResReady {
    #[inline(always)]
    fn serialize(&self, _cursor: &mut Cursor<&mut Vec<u8>>) {}
}

impl FromCursor for BodyResReady {
    #[inline(always)]
    fn from_cursor(_cursor: &mut Cursor<&[u8]>) -> error::Result<Self> {
        Ok(BodyResReady)
    }
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn body_res_ready_new() {
        let body: BodyResReady = Default::default();
        assert_eq!(body, BodyResReady);
    }

    #[test]
    fn body_res_ready_serialize() {
        let body = BodyResReady;
        assert!(body.serialize_to_vec().is_empty());
    }
}