1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use std::fmt;

bitflags::bitflags! {
    #[derive(PartialEq, Eq, Hash, Debug, Clone, Copy)]
    pub struct Capabilities: u32 {
        const TIME_PER_FRAME    = 0x1000;
    }
}

impl From<u32> for Capabilities {
    fn from(caps: u32) -> Self {
        Self::from_bits_retain(caps)
    }
}

impl From<Capabilities> for u32 {
    fn from(capabilities: Capabilities) -> Self {
        capabilities.bits()
    }
}

impl fmt::Display for Capabilities {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        fmt::Debug::fmt(self, f)
    }
}