moqtap_codec/draft19/types.rs
1//! Draft-19 object status values (unchanged from draft-18).
2//!
3//! - 0x0 = Normal
4//! - 0x3 = End of Group
5//! - 0x4 = End of Track
6//!
7//! Draft-19 makes the "which statuses may carry a payload" rule
8//! registry-driven rather than "status != 0 means empty", but the status
9//! code points and their wire encoding are unchanged.
10
11/// Object status values (draft-19).
12#[derive(Debug, Clone, Copy, PartialEq, Eq)]
13#[repr(u8)]
14pub enum ObjectStatus {
15 Normal = 0x0,
16 EndOfGroup = 0x3,
17 EndOfTrack = 0x4,
18}
19
20impl ObjectStatus {
21 pub fn from_u64(v: u64) -> Option<Self> {
22 match v {
23 0x0 => Some(ObjectStatus::Normal),
24 0x3 => Some(ObjectStatus::EndOfGroup),
25 0x4 => Some(ObjectStatus::EndOfTrack),
26 _ => None,
27 }
28 }
29}