[−][src]Struct libbpf_rs::PerfBufferBuilder
Builds PerfBuffer
instances.
Implementations
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 new(map: &'a Map) -> Self
[src]
pub fn set_sample_cb(&mut self, cb: F) -> &mut Self
[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 set_lost_cb(&mut self, cb: G) -> &mut Self
[src]
Callback to run when a sample is received.
Callback arguments are: (cpu, lost_count)
.
pub fn set_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> where
F: Send,
G: Send,
F: Send,
G: Send,
impl<'a, F, G> Sync for PerfBufferBuilder<'a, F, G> where
F: Sync,
G: Sync,
F: Sync,
G: Sync,
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>,