#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct EventQueue(*mut tle_evq);
impl Drop for EventQueue
{
#[inline(always)]
fn drop(&mut self)
{
unsafe { ::dpdk_sys::tle_evq_destroy(self.0) }
}
}
impl EventQueue
{
#[inline(always)]
pub fn create(numaSocketIdToAllocateMemoryFrom: Option<NumaSocketId>, maximumNumberOfEvents: u32) -> Option<EventQueue>
{
let parameters = tle_evq_param
{
socket_id: numaSocketIdToAllocateMemoryFrom.as_int32_t(),
max_events: maximumNumberOfEvents,
};
let result = unsafe { ::dpdk_sys::tle_evq_create(¶meters) };
if unlikely(result.is_null())
{
match unsafe { rust_rte_errno() }
{
E::ENOMEM => None,
E::EINVAL => panic!("Supplied an invalid value"),
illegal @ _ => panic!("Unexpected errno '{}' from tle_evq_create()", illegal),
}
}
else
{
Some(EventQueue(result))
}
}
}