[−][src]Struct libbpf_rs::PerfBufferBuilder
Builds PerfBuffer
instances.
Implementations
impl<'a> PerfBufferBuilder<'a, fn(_: i32, _: &[u8]), fn(_: i32, _: u64)>
[src]
impl<'a, F, G> PerfBufferBuilder<'a, F, G> where
F: FnMut(i32, &[u8]) + 'static,
G: FnMut(i32, u64) + 'static,
[src]
F: FnMut(i32, &[u8]) + 'static,
G: FnMut(i32, u64) + 'static,
pub fn sample_cb<NewF: FnMut(i32, &[u8])>(
self,
cb: NewF
) -> PerfBufferBuilder<'a, NewF, G>
[src]
self,
cb: NewF
) -> PerfBufferBuilder<'a, NewF, G>
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]
self,
cb: NewG
) -> PerfBufferBuilder<'a, F, NewG>
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,
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,
F: UnwindSafe,
G: UnwindSafe,
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,
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.
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>,