Skip to main content

Sink

Trait Sink 

Source
pub trait Sink:
    Send
    + Sync
    + 'static {
    // Required method
    fn deliver(&self, env: ScrubbedEnvelope<'_>);

    // Provided methods
    fn flush(&self) -> Pin<Box<dyn Future<Output = ()> + Send + '_>> { ... }
    fn shutdown(&self) -> Pin<Box<dyn Future<Output = ()> + Send + '_>> { ... }
}
Expand description

A delivery destination. Called from per-tier worker tasks, never on the emit thread.

Required Methods§

Source

fn deliver(&self, env: ScrubbedEnvelope<'_>)

Hand the envelope to the sink. Must not block; long IO is queued internally. Spec 11 § 4 / spec 14 § 5.

Provided Methods§

Source

fn flush(&self) -> Pin<Box<dyn Future<Output = ()> + Send + '_>>

Flush in-flight batches; awaits IO if needed.

Source

fn shutdown(&self) -> Pin<Box<dyn Future<Output = ()> + Send + '_>>

Shut down (drain + close). Idempotent.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl Sink for OtlpLogSink

Source§

fn deliver(&self, env: ScrubbedEnvelope<'_>)

Source§

fn flush(&self) -> Pin<Box<dyn Future<Output = ()> + Send + '_>>

Source§

fn shutdown(&self) -> Pin<Box<dyn Future<Output = ()> + Send + '_>>

Source§

impl Sink for OtlpMetricSink

Source§

fn deliver(&self, env: ScrubbedEnvelope<'_>)

Source§

fn flush(&self) -> Pin<Box<dyn Future<Output = ()> + Send + '_>>

Source§

fn shutdown(&self) -> Pin<Box<dyn Future<Output = ()> + Send + '_>>

Source§

impl Sink for OtlpTraceSink

Source§

fn deliver(&self, env: ScrubbedEnvelope<'_>)

Source§

fn flush(&self) -> Pin<Box<dyn Future<Output = ()> + Send + '_>>

Source§

fn shutdown(&self) -> Pin<Box<dyn Future<Output = ()> + Send + '_>>

Implementors§