pub trait LookupSourceFactory: Send + Sync {
// Required method
fn build<'life0, 'async_trait>(
&'life0 self,
config: ConnectorConfig,
) -> 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§
Sourcefn build<'life0, 'async_trait>(
&'life0 self,
config: ConnectorConfig,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn LookupSourceDyn>, ConnectorError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn build<'life0, 'async_trait>(
&'life0 self,
config: ConnectorConfig,
) -> 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.