Skip to main content

EventSource

Trait EventSource 

Source
pub trait EventSource: Send + Sync {
    // Required methods
    fn schema(&self) -> LadduDataResult<Arc<Schema>>;
    fn batches(&self, plan: ReadPlan) -> LadduDataResult<EventBatchIter>;

    // Provided methods
    fn capabilities(&self) -> SourceCapabilities { ... }
    fn num_events(&self) -> LadduDataResult<Option<u64>> { ... }
    fn weighted_total(&self) -> LadduDataResult<Option<f64>> { ... }
}
Expand description

Thread-safe producer of schema-compatible event batches.

Required Methods§

Source

fn schema(&self) -> LadduDataResult<Arc<Schema>>

Returns the source schema.

§Errors

Returns LadduDataError when source metadata cannot be read or interpreted as a logical schema.

Source

fn batches(&self, plan: ReadPlan) -> LadduDataResult<EventBatchIter>

Opens a batch iterator using plan.

§Errors

Returns LadduDataError when plan is invalid or the source cannot initialize the requested read.

Provided Methods§

Source

fn capabilities(&self) -> SourceCapabilities

Returns optional source capabilities.

Source

fn num_events(&self) -> LadduDataResult<Option<u64>>

Returns the exact event count when cheaply available.

§Errors

Returns LadduDataError when the source cannot read the metadata needed to determine its event count.

Source

fn weighted_total(&self) -> LadduDataResult<Option<f64>>

Returns the exact sum of event weights when cheaply available.

§Errors

Returns LadduDataError when source weights or their metadata cannot be read.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§