[][src]Struct libbpf_rs::PerfBufferBuilder

pub struct PerfBufferBuilder<'a, F, G> where
    F: FnMut(i32, &[u8]) + 'static,
    G: FnMut(i32, u64) + 'static, 
{ /* fields omitted */ }

Builds PerfBuffer instances.

Implementations

impl<'a> PerfBufferBuilder<'a, fn(_: i32, _: &[u8]), fn(_: i32, _: u64)>[src]

pub fn new(map: &'a Map) -> Self[src]

impl<'a, F, G> PerfBufferBuilder<'a, F, G> where
    F: FnMut(i32, &[u8]) + 'static,
    G: FnMut(i32, u64) + 'static, 
[src]

pub fn sample_cb<NewF: FnMut(i32, &[u8])>(
    self,
    cb: NewF
) -> PerfBufferBuilder<'a, NewF, G>
[src]

Callback to run when a sample is received.

This callback provides a raw byte slice. You may find libraries such as plain helpful.

Callback arguments are: (cpu, data).

pub fn lost_cb<NewG: FnMut(i32, u64)>(
    self,
    cb: NewG
) -> PerfBufferBuilder<'a, F, NewG>
[src]

Callback to run when a sample is received.

Callback arguments are: (cpu, lost_count).

pub fn pages(&mut self, pages: usize) -> &mut Self[src]

The number of pages to size the ring buffer.

pub fn build(self) -> Result<PerfBuffer>[src]

Auto Trait Implementations

impl<'a, F, G> RefUnwindSafe for PerfBufferBuilder<'a, F, G> where
    F: RefUnwindSafe,
    G: RefUnwindSafe

impl<'a, F, G> !Send for PerfBufferBuilder<'a, F, G>

impl<'a, F, G> !Sync for PerfBufferBuilder<'a, F, G>

impl<'a, F, G> Unpin for PerfBufferBuilder<'a, F, G>

impl<'a, F, G> UnwindSafe for PerfBufferBuilder<'a, F, G> where
    F: UnwindSafe,
    G: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.