Skip to main content

moqtap_codec/draft15/
types.rs

1//! Draft-15 specific types.
2
3/// Object status values for draft-15 data streams.
4#[derive(Debug, Clone, Copy, PartialEq, Eq)]
5#[repr(u64)]
6pub enum ObjectStatus {
7    Normal = 0x00,
8    ObjectDoesNotExist = 0x01,
9    GroupDoesNotExist = 0x02,
10    EndOfGroup = 0x03,
11    EndOfTrack = 0x04,
12}
13
14impl ObjectStatus {
15    pub fn from_u64(v: u64) -> Option<Self> {
16        match v {
17            0x00 => Some(ObjectStatus::Normal),
18            0x01 => Some(ObjectStatus::ObjectDoesNotExist),
19            0x02 => Some(ObjectStatus::GroupDoesNotExist),
20            0x03 => Some(ObjectStatus::EndOfGroup),
21            0x04 => Some(ObjectStatus::EndOfTrack),
22            _ => None,
23        }
24    }
25}