pub trait ConfigStore: Send + Sync {
// Required methods
fn load_all<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<GatewayConfig, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn commit<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 SharedState,
candidate: GatewayConfig,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
A source of gateway configuration and the sink for Admin API mutations.
Required Methods§
Sourcefn load_all<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<GatewayConfig, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_all<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<GatewayConfig, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Loads the full gateway config from the source.
Sourcefn commit<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 SharedState,
candidate: GatewayConfig,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn commit<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 SharedState,
candidate: GatewayConfig,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Persists a candidate config (the full desired GatewayConfig after an
Admin API mutation) and makes it live.
Implementations must reject invalid config — via
SharedState::validate_gateway — before persisting, so the Admin API
returns an error synchronously rather than accepting a config that would
fail to compile.