pub enum ControlMessage {
Show 18 variants
Setup(Setup),
GoAway(GoAway),
RequestOk(RequestOk),
RequestError(RequestError),
Subscribe(Subscribe),
SubscribeOk(SubscribeOk),
RequestUpdate(RequestUpdate),
Publish(Publish),
PublishStateNotify(PublishStateNotify),
PublishDone(PublishDone),
PublishNamespace(PublishNamespace),
Namespace(Namespace),
NamespaceDone(NamespaceDone),
SubscribeNamespace(SubscribeNamespace),
SubscribeTracks(SubscribeTracks),
TrackStatus(TrackStatus),
Fetch(Fetch),
PublishSkipped(PublishSkipped),
}Variants§
Setup(Setup)
GoAway(GoAway)
RequestOk(RequestOk)
RequestError(RequestError)
Subscribe(Subscribe)
SubscribeOk(SubscribeOk)
RequestUpdate(RequestUpdate)
Publish(Publish)
PublishStateNotify(PublishStateNotify)
PublishDone(PublishDone)
PublishNamespace(PublishNamespace)
Namespace(Namespace)
NamespaceDone(NamespaceDone)
SubscribeNamespace(SubscribeNamespace)
SubscribeTracks(SubscribeTracks)
TrackStatus(TrackStatus)
Fetch(Fetch)
PublishSkipped(PublishSkipped)
Implementations§
Source§impl ControlMessage
impl ControlMessage
Sourcepub fn encode(&self, buf: &mut impl BufMut) -> Result<(), CodecError>
pub fn encode(&self, buf: &mut impl BufMut) -> Result<(), CodecError>
Encode under the default MAX_CONTROL_MESSAGE_SIZE of 65535, which is the limit until the peer’s SETUP arrives (Section 9.1.8).
Sourcepub fn encode_with_limit(
&self,
buf: &mut impl BufMut,
limit: u64,
) -> Result<(), CodecError>
pub fn encode_with_limit( &self, buf: &mut impl BufMut, limit: u64, ) -> Result<(), CodecError>
Encode for a peer whose MAX_CONTROL_MESSAGE_SIZE is limit.
Section 9: “An endpoint MUST NOT send a control message with a length larger than the peer’s MAX_CONTROL_MESSAGE_SIZE (Section 9.1.8).” The length is the Message Length field, the body alone.
Sourcepub fn decode(buf: &mut impl Buf) -> Result<Self, CodecError>
pub fn decode(buf: &mut impl Buf) -> Result<Self, CodecError>
Decode under the default MAX_CONTROL_MESSAGE_SIZE of 65535: the limit of an endpoint that advertised none (Section 9.1.8).
Sourcepub fn decode_with_limit(
buf: &mut impl Buf,
limit: u64,
) -> Result<Self, CodecError>
pub fn decode_with_limit( buf: &mut impl Buf, limit: u64, ) -> Result<Self, CodecError>
Decode as an endpoint whose own MAX_CONTROL_MESSAGE_SIZE is limit.
Section 9: “If an endpoint receives a control message with a length larger than its MAX_CONTROL_MESSAGE_SIZE, it MUST close the session with FIELD_LENGTH_EXCEEDED.” The Length is checked before the body is waited for, so an oversized message is refused as soon as its Length has arrived.