Skip to main content

TelemetrySink

Trait TelemetrySink 

Source
pub trait TelemetrySink:
    Send
    + Sync
    + 'static {
    // Required method
    fn emit<'life0, 'life1, 'async_trait>(
        &'life0 self,
        event: &'life1 Event,
    ) -> Pin<Box<dyn Future<Output = Result<(), TelemetryError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided method
    fn flush<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), TelemetryError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Backend-agnostic sink for Event values.

Required Methods§

Source

fn emit<'life0, 'life1, 'async_trait>( &'life0 self, event: &'life1 Event, ) -> Pin<Box<dyn Future<Output = Result<(), TelemetryError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Emit a single event. Sinks SHOULD be idempotent on the event — retries or batching live in wrapper sinks (v0.2).

Provided Methods§

Source

fn flush<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), TelemetryError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Flush any buffered events. Default impl is a no-op.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§