pub trait Source: Send + Sync {
// Required method
fn fetch_all<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Value>, FaucetError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
// Provided methods
fn fetch_all_incremental<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(Vec<Value>, Option<Value>), FaucetError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait { ... }
fn config_schema(&self) -> Value { ... }
}Expand description
A source fetches records from an external system.
Required Methods§
Provided Methods§
Sourcefn fetch_all_incremental<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(Vec<Value>, Option<Value>), FaucetError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn fetch_all_incremental<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(Vec<Value>, Option<Value>), FaucetError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Fetch all records with incremental replication support.
Returns the records and an optional bookmark value. The bookmark should be persisted by the caller and passed back on the next run to resume from where the previous run left off.
The default implementation delegates to fetch_all
and returns None for the bookmark.
Sourcefn config_schema(&self) -> Value
fn config_schema(&self) -> Value
Return a JSON Schema describing the configuration this source accepts.
The schema is auto-generated from the config struct using schemars.
Callers can inspect it to discover required fields, types, defaults,
and descriptions before constructing the source.
The default returns an empty object schema.