pub struct DatagramStatusHeader {
pub track_alias: VarInt,
pub group_id: VarInt,
pub object_id: VarInt,
pub publisher_priority: u8,
pub extension_headers_length: VarInt,
pub extensions: Vec<u8>,
pub object_status: ObjectStatus,
}Expand description
Datagram status header (draft-11, types 0x02/0x03).
Fields§
§track_alias: VarIntTrack alias identifying the subscription.
group_id: VarIntGroup identifier.
object_id: VarIntObject identifier within the group.
publisher_priority: u8Publisher priority for delivery ordering.
extension_headers_length: VarIntTotal byte length of extension headers (0 for type 0x02).
extensions: Vec<u8>Raw extension bytes.
object_status: ObjectStatusObject status code.
Implementations§
Source§impl DatagramStatusHeader
impl DatagramStatusHeader
Sourcepub fn encode_checked(&self, buf: &mut impl BufMut) -> Result<(), CodecError>
pub fn encode_checked(&self, buf: &mut impl BufMut) -> Result<(), CodecError>
Encode the status datagram header, refusing an extension block this framing cannot carry.
The same one-sided rule the payload-bearing header obeys, and the same
reason for it: Self::encode writes the framing without a block, so
bytes held here would be dropped rather than written.
§Errors
CodecError::InvalidField if the value carries extension headers.
Sourcepub fn encode_with_extensions(
&self,
has_extensions: bool,
buf: &mut impl BufMut,
)
pub fn encode_with_extensions( &self, has_extensions: bool, buf: &mut impl BufMut, )
Encode the datagram status header with extensions control.
Sourcepub fn decode(buf: &mut impl Buf) -> Result<Self, CodecError>
pub fn decode(buf: &mut impl Buf) -> Result<Self, CodecError>
Decode a datagram status header (no extensions).
Sourcepub fn decode_with_extensions(
has_extensions: bool,
buf: &mut impl Buf,
) -> Result<Self, CodecError>
pub fn decode_with_extensions( has_extensions: bool, buf: &mut impl Buf, ) -> Result<Self, CodecError>
Decode a datagram status header with extensions control.
Trait Implementations§
Source§impl Clone for DatagramStatusHeader
impl Clone for DatagramStatusHeader
Source§fn clone(&self) -> DatagramStatusHeader
fn clone(&self) -> DatagramStatusHeader
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more