Struct libbpf_rs::PerfBufferBuilder
source · pub struct PerfBufferBuilder<'a, 'b> { /* private fields */ }
Expand description
Builds PerfBuffer
instances.
Implementations§
source§impl<'a> PerfBufferBuilder<'a, '_>
impl<'a> PerfBufferBuilder<'a, '_>
source§impl<'a, 'b> PerfBufferBuilder<'a, 'b>
impl<'a, 'b> PerfBufferBuilder<'a, 'b>
sourcepub fn sample_cb<NewCb: SampleCb + 'b>(
self,
cb: NewCb,
) -> PerfBufferBuilder<'a, 'b>
pub fn sample_cb<NewCb: SampleCb + 'b>( self, cb: NewCb, ) -> PerfBufferBuilder<'a, 'b>
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)
.
sourcepub fn lost_cb<NewCb: LostCb + 'b>(self, cb: NewCb) -> PerfBufferBuilder<'a, 'b>
pub fn lost_cb<NewCb: LostCb + 'b>(self, cb: NewCb) -> PerfBufferBuilder<'a, 'b>
Callback to run when a sample is received.
Callback arguments are: (cpu, lost_count)
.
sourcepub fn pages(self, pages: usize) -> PerfBufferBuilder<'a, 'b>
pub fn pages(self, pages: usize) -> PerfBufferBuilder<'a, 'b>
The number of pages to size the ring buffer.
sourcepub fn build(self) -> Result<PerfBuffer<'b>>
pub fn build(self) -> Result<PerfBuffer<'b>>
Build the PerfBuffer
object as configured.
Trait Implementations§
Auto Trait Implementations§
impl<'a, 'b> Freeze for PerfBufferBuilder<'a, 'b>
impl<'a, 'b> !RefUnwindSafe for PerfBufferBuilder<'a, 'b>
impl<'a, 'b> !Send for PerfBufferBuilder<'a, 'b>
impl<'a, 'b> !Sync for PerfBufferBuilder<'a, 'b>
impl<'a, 'b> Unpin for PerfBufferBuilder<'a, 'b>
impl<'a, 'b> !UnwindSafe for PerfBufferBuilder<'a, 'b>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more