use crate::coding::{decode_string, encode_string, DecodeError, EncodeError}; use crate::coding::{AsyncRead, AsyncWrite}; /// Sent by the publisher to terminate an Announce. #[derive(Clone, Debug)] pub struct AnnounceStop { // Echo back the namespace that was reset pub namespace: String, } impl AnnounceStop { pub async fn decode(r: &mut R) -> Result { let namespace = decode_string(r).await?; Ok(Self { namespace }) } pub async fn encode(&self, w: &mut W) -> Result<(), EncodeError> { encode_string(&self.namespace, w).await?; Ok(()) } }