moq_transport/message/
track_status_request.rs

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
use crate::coding::{Decode, DecodeError, Encode, EncodeError};

#[derive(Clone, Debug)]
pub struct TrackStatusRequest {
	/// Track Namespace
	pub track_namespace: String,
	/// Track Name
	pub track_name: String,
}

impl Decode for TrackStatusRequest {
	fn decode<R: bytes::Buf>(r: &mut R) -> Result<Self, DecodeError> {
		let track_namespace = String::decode(r)?;
		let track_name = String::decode(r)?;

		Ok(Self {
			track_namespace,
			track_name,
		})
	}
}

impl Encode for TrackStatusRequest {
	fn encode<W: bytes::BufMut>(&self, w: &mut W) -> Result<(), EncodeError> {
		self.track_namespace.encode(w)?;
		self.track_name.encode(w)?;

		Ok(())
	}
}