pub struct PerfEventArrayBuffer<T: DerefMut<Target = Map>> { /* private fields */ }
Expand description

A ring buffer that can receive events from eBPF programs.

PerfEventArrayBuffer is a ring buffer that can receive events from eBPF programs that use bpf_perf_event_output(). It’s returned by PerfEventArray::open.

See the PerfEventArray documentation for an overview of how to use perf buffers.

Implementations

Returns true if the buffer contains events that haven’t been read.

Reads events from the buffer.

This method reads events into the provided slice of buffers, filling each buffer in order stopping when there are no more events to read or all the buffers have been filled.

Returns the number of events read and the number of events lost. Events are lost when user space doesn’t read events fast enough and the ring buffer fills up.

Errors

PerfBufferError::NoBuffers is returned when out_bufs is empty.

Trait Implementations

Extracts the raw file descriptor. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.