[−][src]Struct libbpf_rs::RingBufferBuilder
Builds RingBuffer instances.
ringbufs are a special kind of Map, used to transfer data between
Programs and userspace. As of Linux 5.8, the ringbuf map is now
preferred over the perf buffer.
Implementations
impl RingBufferBuilder[src]
pub fn new() -> Self[src]
pub fn add<NewF>(&mut self, map: &Map, callback: NewF) -> Result<&mut Self> where
NewF: FnMut(&[u8]) -> i32 + 'static, [src]
NewF: FnMut(&[u8]) -> i32 + 'static,
Add a new ringbuf map and associated callback to this ring buffer
manager. The callback should take one argument, a slice of raw bytes,
and return an i32.
Non-zero return values in the callback will stop ring buffer consumption early.
The callback provides a raw byte slice. You may find libraries such as
plain helpful.
pub fn build(self) -> Result<RingBuffer>[src]
Build a new RingBuffer. Must have added at least one ringbuf.
Trait Implementations
impl Default for RingBufferBuilder[src]
pub fn default() -> RingBufferBuilder[src]
Auto Trait Implementations
impl !RefUnwindSafe for RingBufferBuilder[src]
impl !Send for RingBufferBuilder[src]
impl !Sync for RingBufferBuilder[src]
impl Unpin for RingBufferBuilder[src]
impl !UnwindSafe for RingBufferBuilder[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,