cassandra_protocol/frame/
message_ready.rs1use crate::error;
2use crate::frame::{FromCursor, Serialize, Version};
3use std::io::Cursor;
4
5#[derive(Clone, Debug, PartialEq, Default, Ord, PartialOrd, Eq, Hash, Copy)]
6pub struct BodyResReady;
7
8impl Serialize for BodyResReady {
9 #[inline(always)]
10 fn serialize(&self, _cursor: &mut Cursor<&mut Vec<u8>>, _version: Version) {}
11}
12
13impl FromCursor for BodyResReady {
14 #[inline(always)]
15 fn from_cursor(_cursor: &mut Cursor<&[u8]>, _version: Version) -> error::Result<Self> {
16 Ok(BodyResReady)
17 }
18}
19
20#[cfg(test)]
21mod tests {
22 use super::*;
23
24 #[test]
25 fn body_res_ready_new() {
26 let body: BodyResReady = Default::default();
27 assert_eq!(body, BodyResReady);
28 }
29
30 #[test]
31 fn body_res_ready_serialize() {
32 let body = BodyResReady;
33 assert!(body.serialize_to_vec(Version::V4).is_empty());
34 }
35}