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§
Sourcefn schema(&self) -> LadduDataResult<Arc<Schema>>
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.
Sourcefn batches(&self, plan: ReadPlan) -> LadduDataResult<EventBatchIter>
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§
Sourcefn capabilities(&self) -> SourceCapabilities
fn capabilities(&self) -> SourceCapabilities
Returns optional source capabilities.
Sourcefn num_events(&self) -> LadduDataResult<Option<u64>>
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.
Sourcefn weighted_total(&self) -> LadduDataResult<Option<f64>>
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".