Trait Processor

Source
pub trait Processor: Send + 'static {
    // Required methods
    fn process(
        &mut self,
        line: String,
        timestamp: Timestamp,
    ) -> impl Future<Output = ()> + Send;
    fn truncate(&mut self) -> impl Future<Output = ()> + Send;
}

Required Methods§

Source

fn process( &mut self, line: String, timestamp: Timestamp, ) -> impl Future<Output = ()> + Send

Process a log line. The line is guaranteed to be non-empty and does not contain a newline character.

The line may be an EMF line. You can use the is_emf util function to check if it is.

Source

fn truncate(&mut self) -> impl Future<Output = ()> + Send

Flushes the underlying output stream, ensuring that all intermediately buffered contents reach their destination. This method is called when the current invocation is about to end (the proxy got the request of invocation/next).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Processor for ()

Source§

async fn process(&mut self, _line: String, _timestamp: Timestamp)

Source§

async fn truncate(&mut self)

Implementors§