pub struct DatagramHeader {
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>,
}Expand description
Datagram header (draft-11, types 0x00/0x01).
Payload is the remaining bytes in the datagram after the header.
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 0x00).
extensions: Vec<u8>Raw extension bytes.
Implementations§
Source§impl DatagramHeader
impl DatagramHeader
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 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 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 header with extensions control.
Trait Implementations§
Source§impl Clone for DatagramHeader
impl Clone for DatagramHeader
Source§fn clone(&self) -> DatagramHeader
fn clone(&self) -> DatagramHeader
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DatagramHeader
impl Debug for DatagramHeader
Source§impl PartialEq for DatagramHeader
impl PartialEq for DatagramHeader
impl Eq for DatagramHeader
impl StructuralPartialEq for DatagramHeader
Auto Trait Implementations§
impl Freeze for DatagramHeader
impl RefUnwindSafe for DatagramHeader
impl Send for DatagramHeader
impl Sync for DatagramHeader
impl Unpin for DatagramHeader
impl UnsafeUnpin for DatagramHeader
impl UnwindSafe for DatagramHeader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more