#[repr(C)]
#[derive(Copy, Clone, Eq)]
pub(crate) union epoll_data_t
{
pub(crate) ptr: *mut c_void,
pub(crate) fd: RawFd,
pub(crate) u32: u32,
pub(crate) u64: u64,
}
impl Default for epoll_data_t
{
#[inline(always)]
fn default() -> Self
{
unsafe_zeroed()
}
}
impl Debug for epoll_data_t
{
#[inline(always)]
fn fmt(&self, f: &mut Formatter) -> fmt::Result
{
write!(f, "{}", unsafe { self.u64 })
}
}
impl PartialEq for epoll_data_t
{
#[inline(always)]
fn eq(&self, other: &Self) -> bool
{
unsafe { self.u64 == other.u64 }
}
}
impl Hash for epoll_data_t
{
#[inline(always)]
fn hash<H: Hasher>(&self, hasher: &mut H)
{
unsafe { self.u64.hash(hasher) }
}
}
impl PartialOrd for epoll_data_t
{
#[inline(always)]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
{
unsafe { self.u64.partial_cmp(&other.u64) }
}
}
impl Ord for epoll_data_t
{
#[inline(always)]
fn cmp(&self, other: &Self) -> Ordering
{
unsafe { self.u64.cmp(&other.u64) }
}
}