Skip to main content

LogSink

Trait LogSink 

Source
pub trait LogSink:
    Send
    + Sync
    + 'static {
    // Required methods
    fn send<'a>(
        &'a self,
        batch: &'a [ForwardDocument],
    ) -> BoxFuture<'a, BatchOutcome>;
    fn describe(&self) -> String;
}
Expand description

Somewhere documents can be sent.

Boxed futures rather than async fn so the forwarder can hold a dyn LogSink and swap a mock in under test without being generic over the sink everywhere.

Required Methods§

Source

fn send<'a>( &'a self, batch: &'a [ForwardDocument], ) -> BoxFuture<'a, BatchOutcome>

Source

fn describe(&self) -> String

Short description of the destination, for status output and logs.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§