Skip to main content

EventSink

Trait EventSink 

Source
pub trait EventSink: Send {
    // Required methods
    fn begin(
        &mut self,
        schema: Arc<Schema>,
        plan: WritePlan,
    ) -> LadduDataResult<()>;
    fn write_batch(&mut self, batch: &EventBatch) -> LadduDataResult<()>;
    fn finish(&mut self) -> LadduDataResult<()>;

    // Provided method
    fn retains_batches(&self) -> bool { ... }
}
Expand description

Consumer of schema-compatible event batches.

Required Methods§

Source

fn begin(&mut self, schema: Arc<Schema>, plan: WritePlan) -> LadduDataResult<()>

Begins a write operation.

§Errors

Returns LadduDataError when the plan or schema is unsupported or output initialization fails.

Source

fn write_batch(&mut self, batch: &EventBatch) -> LadduDataResult<()>

Writes one batch.

§Errors

Returns LadduDataError when the batch schema is incompatible or the output cannot be written.

Source

fn finish(&mut self) -> LadduDataResult<()>

Finishes and flushes the write operation.

§Errors

Returns LadduDataError when buffered output cannot be finalized.

Provided Methods§

Source

fn retains_batches(&self) -> bool

Returns whether written batches remain resident in memory.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§