moq_transfork/message/
frame.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use crate::coding::*;

#[derive(Clone, Debug)]
pub struct Frame {
	pub size: usize,
}

impl Decode for Frame {
	fn decode<R: bytes::Buf>(r: &mut R) -> Result<Self, DecodeError> {
		Ok(Self {
			size: usize::decode(r)?,
		})
	}
}

impl Encode for Frame {
	fn encode<W: bytes::BufMut>(&self, w: &mut W) {
		self.size.encode(w);
	}
}