#[derive(Copy, Clone, Debug, PartialOrd, Ord, PartialEq, Eq, Hash)]
pub struct GloballyRetrievedLifecycle;
impl Lifecycle for GloballyRetrievedLifecycle
{
#[allow(unused_variables)]
#[inline(always)]
fn free(ring: *mut rte_ring)
{
}
}
impl GloballyRetrievedLifecycle
{
pub fn lookup(name: &str) -> Option<RingQueue<InefficientProducer, InefficientConsumer, GloballyRetrievedLifecycle>>
{
#[cfg(debug_assertions)] Self::guardMaximumNameLength(name);
let cName = CString::new(name).expect("GloballyRetrievedLifecycle.lookup() name contained an interior ASCII NUL and couldn't be converted to a CString");
let result = unsafe { ::dpdk_sys::rte_ring_lookup(cName.as_ptr()) };
if unlikely(result.is_null())
{
match unsafe { rust_rte_errno() }
{
E::ENOENT => None,
unexpected @ _ => panic!("Unexpected error code '{}' from rte_ring_lookup()", unexpected),
}
}
else
{
Some(RingQueue::new(result))
}
}
#[inline(always)]
pub fn dumpAllToStandardError()
{
unsafe
{
::dpdk_sys::rte_ring_list_dump(stderr as *mut FILE);
}
}
}