pub trait CpuBufferWriter: BufferWriter + Default {
type Item: CpuSample;
// Required methods
fn slice_with_tags(&mut self) -> (&mut [Self::Item], Tags<'_>);
fn produce(&mut self, n: usize);
fn set_min_items(&mut self, n: usize);
fn set_min_buffer_size_in_items(&mut self, n: usize);
fn max_items(&self) -> usize;
// Provided method
fn slice(&mut self) -> &mut [Self::Item] { ... }
}Expand description
CPU stream writer API.
This is the primary local API. Native send-capable writers are derived from this trait through a blanket impl.
Required Associated Types§
Required Methods§
Get writable slice and tag sink.
The returned slice starts at the next unproduced output item. Tags added
through Tags use indices relative to this slice.
Sourcefn produce(&mut self, n: usize)
fn produce(&mut self, n: usize)
Mark n items as produced.
n must not exceed the number of items written into the last writable
slice.
Sourcefn set_min_items(&mut self, n: usize)
fn set_min_items(&mut self, n: usize)
Set minimum number of writable items.
Sourcefn set_min_buffer_size_in_items(&mut self, n: usize)
fn set_min_buffer_size_in_items(&mut self, n: usize)
Set minimum buffer size.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.