pub trait SnapshotLoader:
Send
+ Sync
+ 'static {
type Snapshot: Send + Sync;
const NAME: &'static str;
// Required methods
fn fetch<'life0, 'async_trait>(
pool: &'life0 Pool<Postgres>,
) -> Pin<Box<dyn Future<Output = Result<Self::Snapshot, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn count_refresh_error();
}Expand description
What a SnapshotSource needs from a specific store: how to fetch a fresh snapshot from the
pool, and the name/metric to report on a refresh failure.
Required Associated Constants§
Required Associated Types§
Required Methods§
Sourcefn fetch<'life0, 'async_trait>(
pool: &'life0 Pool<Postgres>,
) -> Pin<Box<dyn Future<Output = Result<Self::Snapshot, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn fetch<'life0, 'async_trait>(
pool: &'life0 Pool<Postgres>,
) -> Pin<Box<dyn Future<Output = Result<Self::Snapshot, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Queries the whole table(s) and builds a fresh snapshot.
Sourcefn count_refresh_error()
fn count_refresh_error()
Emits this store’s own refresh-error metric (imetric!() with its own literal name) –
called by SnapshotSource::current at both failure sites.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".