pub struct DatagramHeader {
pub datagram_type: u8,
pub track_alias: VarInt,
pub group_id: VarInt,
pub object_id: VarInt,
pub publisher_priority: u8,
pub extension_headers: Vec<u8>,
pub object_status: Option<VarInt>,
}Expand description
Datagram header for draft-15.
The datagram_type byte encodes flags:
0x02: end-of-group0x04: no object_id (object_id = 0 implied)0x20: status datagram (carries object_status instead of payload)
Fields§
§datagram_type: u8Raw datagram-type byte encoding flags + kind.
track_alias: VarIntTrack alias identifying the track.
group_id: VarIntGroup ID for the contained object.
object_id: VarIntObject ID (zero when the no-object-id flag is set).
publisher_priority: u8Publisher priority.
extension_headers: Vec<u8>Opaque extension-headers blob (only when the 0x01 flag is set).
object_status: Option<VarInt>Object status (only when the 0x20 status flag is set).
Implementations§
Source§impl DatagramHeader
impl DatagramHeader
Sourcepub fn has_object_id(&self) -> bool
pub fn has_object_id(&self) -> bool
Whether the datagram carries an explicit object_id.
Sourcepub fn is_end_of_group(&self) -> bool
pub fn is_end_of_group(&self) -> bool
Whether this datagram marks the end of its group.
Sourcepub fn is_status(&self) -> bool
pub fn is_status(&self) -> bool
Whether this datagram carries an object_status instead of payload.
Sourcepub fn has_extensions(&self) -> bool
pub fn has_extensions(&self) -> bool
Whether this datagram carries extension headers.
Sourcepub fn decode(buf: &mut impl Buf) -> Result<Self, CodecError>
pub fn decode(buf: &mut impl Buf) -> Result<Self, CodecError>
Decode a datagram header from buf.
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