Struct libbpf_rs::RingBuffer
source · 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
.
§type LibbpfType = ring_buffer
type LibbpfType = ring_buffer
libbpf
type.