Skip to main content

OffThreadSpectraSink

Struct OffThreadSpectraSink 

Source
pub struct OffThreadSpectraSink { /* private fields */ }
Expand description

Sink that enqueues NDJSON + optional console mirror work for a background thread.

Implementations§

Source§

impl OffThreadSpectraSink

Source

pub fn new(ndjson: NdjsonFileSink) -> Self

Spawn the background writer thread and wire the shared emit queue.

Source

pub fn ndjson(&self) -> &NdjsonFileSink

Underlying NDJSON file sink (used by the worker thread).

Trait Implementations§

Source§

impl SpectraSink for OffThreadSpectraSink

Source§

fn record_counter(&self, name: &str, labels: &[(&str, &str)], delta: i64)

Increment (or decrement) a counter.
Source§

fn record_gauge(&self, name: &str, labels: &[(&str, &str)], value: f64)

Set a gauge value.
Source§

fn log_event(&self, table: &str, fields: &Value)

Append a structured event row.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.