moq_transport/message/
announce_error.rsuse crate::coding::{Decode, DecodeError, Encode, EncodeError};
#[derive(Clone, Debug)]
pub struct AnnounceError {
pub namespace: String,
pub code: u64,
pub reason: String,
}
impl Decode for AnnounceError {
fn decode<R: bytes::Buf>(r: &mut R) -> Result<Self, DecodeError> {
let namespace = String::decode(r)?;
let code = u64::decode(r)?;
let reason = String::decode(r)?;
Ok(Self {
namespace,
code,
reason,
})
}
}
impl Encode for AnnounceError {
fn encode<W: bytes::BufMut>(&self, w: &mut W) -> Result<(), EncodeError> {
self.namespace.encode(w)?;
self.code.encode(w)?;
self.reason.encode(w)?;
Ok(())
}
}