bnr_xfs/denominations/denomination_info/
security_level.rs1use std::fmt;
2
3use crate::impl_xfs_i4;
4
5#[derive(Clone, Copy, Debug, Eq, PartialEq)]
7pub struct SecurityLevel(u32);
8
9impl SecurityLevel {
10    pub const fn new() -> Self {
12        Self(0)
13    }
14
15    pub const fn create(c: u32) -> Self {
17        Self(c)
18    }
19
20    pub const fn inner(&self) -> u32 {
22        self.0
23    }
24
25    pub fn set_inner(&mut self, v: u32) {
27        self.0 = v;
28    }
29
30    pub fn into_inner(self) -> u32 {
32        self.0
33    }
34}
35
36impl Default for SecurityLevel {
37    fn default() -> Self {
38        Self::new()
39    }
40}
41
42impl fmt::Display for SecurityLevel {
43    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
44        write!(f, "{}", self.inner())
45    }
46}
47
48impl_xfs_i4!(SecurityLevel, "securityLevel");