Skip to main content

LookupSourceFactory

Trait LookupSourceFactory 

Source
pub trait LookupSourceFactory: Send + Sync {
    // Required method
    fn build<'life0, 'async_trait>(
        &'life0 self,
        config: ConnectorConfig,
        declared_schema: Option<SchemaRef>,
    ) -> Pin<Box<dyn Future<Output = Result<Arc<dyn LookupSourceDyn>, ConnectorError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Factory for constructing a lookup source (async, for on-demand mode).

Previously this was a hand-rolled Arc<dyn Fn(...) -> Pin<Box<Future>>> type alias that nobody could read. A trait with an async method says the same thing without forcing the caller to spell out the Pin<Box<...>>.

Required Methods§

Source

fn build<'life0, 'async_trait>( &'life0 self, config: ConnectorConfig, declared_schema: Option<SchemaRef>, ) -> Pin<Box<dyn Future<Output = Result<Arc<dyn LookupSourceDyn>, ConnectorError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Build a lookup source instance from the given config.

declared_schema is the table’s declared Arrow schema (from the CREATE LOOKUP TABLE columns), when known. Schema-bearing sources (Delta/Iceberg/Postgres) derive their own and ignore it; schemaless sources (MongoDB) need it to project documents into typed columns.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§