use core::ffi::c_uint;
pub type RawGid = c_uint;
pub type RawUid = c_uint;
#[repr(transparent)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct Uid(RawUid);
#[repr(transparent)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct Gid(RawGid);
impl Uid {
pub const ROOT: Self = Self(0);
#[inline]
pub const unsafe fn from_raw(raw: RawUid) -> Self {
Self(raw)
}
#[inline]
pub const fn as_raw(self) -> RawUid {
self.0
}
#[inline]
pub const fn is_root(self) -> bool {
self.0 == Self::ROOT.0
}
}
impl Gid {
pub const ROOT: Self = Self(0);
#[inline]
pub const unsafe fn from_raw(raw: RawGid) -> Self {
Self(raw)
}
#[inline]
pub const fn as_raw(self) -> RawGid {
self.0
}
#[inline]
pub const fn is_root(self) -> bool {
self.0 == Self::ROOT.0
}
}