pub struct AsyncTelemetryWriter { /* private fields */ }Expand description
Asynchronous Telemetry Writer backed by a bounded ring buffer.
Implementations§
Source§impl AsyncTelemetryWriter
impl AsyncTelemetryWriter
Sourcepub fn new(capacity: usize, batch_size: usize, flush_interval: Duration) -> Self
pub fn new(capacity: usize, batch_size: usize, flush_interval: Duration) -> Self
Create and spawn a new background batch writer with bounded buffer capacity.
Sourcepub fn enqueue(&self, item: TelemetryItem) -> Result<(), &'static str>
pub fn enqueue(&self, item: TelemetryItem) -> Result<(), &'static str>
Non-blocking enqueue of a telemetry event (< 10µs).
Sourcepub fn flush_sync(&self) -> Result<(), &'static str>
pub fn flush_sync(&self) -> Result<(), &'static str>
Synchronous barrier: blocks until all currently queued events are committed.
Trait Implementations§
Source§impl Drop for AsyncTelemetryWriter
impl Drop for AsyncTelemetryWriter
Auto Trait Implementations§
impl !RefUnwindSafe for AsyncTelemetryWriter
impl !UnwindSafe for AsyncTelemetryWriter
impl Forget for AsyncTelemetryWriter
impl Freeze for AsyncTelemetryWriter
impl Send for AsyncTelemetryWriter
impl Sync for AsyncTelemetryWriter
impl Unpin for AsyncTelemetryWriter
impl UnsafeUnpin for AsyncTelemetryWriter
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