use core::fmt::{self, Debug, Formatter};
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(transparent)] pub struct MaskMask(pub(super) u32);
#[derive(Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(transparent)] pub struct Mask(pub(super) u32);
flags!(impl .. for Mask(u32) - MaskMask);
impl Mask {
pub const unsafe fn from_unchecked(rights: u32) -> Self { Self(rights) }
}
impl Debug for Mask {
fn fmt(&self, fmt: &mut Formatter) -> fmt::Result {
use winapi::um::winnt::*;
flags!(self.0, fmt, "0x{:04X}", [
GENERIC_ALL,
GENERIC_EXECUTE,
GENERIC_WRITE,
GENERIC_READ,
MAXIMUM_ALLOWED,
ACCESS_SYSTEM_SECURITY,
DELETE,
READ_CONTROL,
WRITE_DAC,
WRITE_OWNER,
SYNCHRONIZE,
])
}
}