pub struct PerfBufferBuilder<'a, 'b, M>where
M: MapCore,{ /* private fields */ }
Expand description
Builds PerfBuffer
instances.
Implementations§
Source§impl<'a, M> PerfBufferBuilder<'a, '_, M>where
M: MapCore,
impl<'a, M> PerfBufferBuilder<'a, '_, M>where
M: MapCore,
Source§impl<'a, 'b, M> PerfBufferBuilder<'a, 'b, M>where
M: MapCore,
impl<'a, 'b, M> PerfBufferBuilder<'a, 'b, M>where
M: MapCore,
Sourcepub fn sample_cb<F>(self, cb: F) -> PerfBufferBuilder<'a, 'b, M>
pub fn sample_cb<F>(self, cb: F) -> PerfBufferBuilder<'a, 'b, M>
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<F>(self, cb: F) -> PerfBufferBuilder<'a, 'b, M>
pub fn lost_cb<F>(self, cb: F) -> PerfBufferBuilder<'a, 'b, M>
Callback to run when a sample is received.
Callback arguments are: (cpu, lost_count)
.
Sourcepub fn pages(self, pages: usize) -> PerfBufferBuilder<'a, 'b, M>
pub fn pages(self, pages: usize) -> PerfBufferBuilder<'a, 'b, M>
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, M> Freeze for PerfBufferBuilder<'a, 'b, M>
impl<'a, 'b, M> !RefUnwindSafe for PerfBufferBuilder<'a, 'b, M>
impl<'a, 'b, M> !Send for PerfBufferBuilder<'a, 'b, M>
impl<'a, 'b, M> !Sync for PerfBufferBuilder<'a, 'b, M>
impl<'a, 'b, M> Unpin for PerfBufferBuilder<'a, 'b, M>
impl<'a, 'b, M> !UnwindSafe for PerfBufferBuilder<'a, 'b, M>
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