Skip to main content

moqtap_codec/draft17/
types.rs

1//! Draft-17 object status values.
2//!
3//! Draft-17 changes status codes from draft-16:
4//! - 0x0 = Normal
5//! - 0x3 = End of Group (was 0x1)
6//! - 0x4 = End of Track (was 0x2)
7//! - DoesNotExist removed
8
9/// Object status values (draft-17).
10#[derive(Debug, Clone, Copy, PartialEq, Eq)]
11#[repr(u8)]
12pub enum ObjectStatus {
13    Normal = 0x0,
14    EndOfGroup = 0x3,
15    EndOfTrack = 0x4,
16}
17
18impl ObjectStatus {
19    pub fn from_u64(v: u64) -> Option<Self> {
20        match v {
21            0x0 => Some(ObjectStatus::Normal),
22            0x3 => Some(ObjectStatus::EndOfGroup),
23            0x4 => Some(ObjectStatus::EndOfTrack),
24            _ => None,
25        }
26    }
27}