pub struct RingBuffer<'cb> { /* private fields */ }
Expand description
Implementations§
Source§impl RingBuffer<'_>
impl RingBuffer<'_>
Sourcepub fn poll_raw(&self, timeout: Duration) -> i32
pub fn poll_raw(&self, timeout: Duration) -> i32
Poll from all open ring buffers, calling the registered callback for
each one. Polls continually until we either run out of events to consume
or timeout
is reached. If timeout
is Duration::MAX, this will block
indefinitely until an event occurs.
Return the amount of events consumed, or a negative value in case of error.
Sourcepub fn poll(&self, timeout: Duration) -> Result<()>
pub fn poll(&self, timeout: Duration) -> Result<()>
Poll from all open ring buffers, calling the registered callback for
each one. Polls continually until we either run out of events to consume
or timeout
is reached. If timeout
is Duration::MAX, this will block
indefinitely until an event occurs.
Sourcepub fn consume_raw(&self) -> i32
pub fn consume_raw(&self) -> i32
Greedily consume from all open ring buffers, calling the registered callback for each one. Consumes continually until we run out of events to consume or one of the callbacks returns a non-zero integer.
Return the amount of events consumed, or a negative value in case of error.
Trait Implementations§
Source§impl AsRawLibbpf for RingBuffer<'_>
impl AsRawLibbpf for RingBuffer<'_>
Source§fn as_libbpf_object(&self) -> NonNull<Self::LibbpfType>
fn as_libbpf_object(&self) -> NonNull<Self::LibbpfType>
Retrieve the underlying libbpf_sys::ring_buffer
.
Source§type LibbpfType = ring_buffer
type LibbpfType = ring_buffer
libbpf
type.