pub trait AsyncConfigProvider: Send + Sync {
type Config: Send + Sync;
type Error: Error + Send + Sync + 'static;
// Required methods
fn load<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Self::Config>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 Self::Config,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn validate<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 Self::Config,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn default_config<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Self::Config> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn watch_changes<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<Self::Config>> + Send + 'static>>>> + Send + 'async_trait>>
where Self::Config: 'static,
Self: 'async_trait,
'life0: 'async_trait { ... }
fn reload<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Self::Config>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Expand description
Async configuration management abstraction for non-blocking configuration operations
§Async Version
This trait provides async operations for configuration management with better I/O handling.
Required Associated Types§
Required Methods§
Sourcefn load<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Self::Config>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Self::Config>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Load configuration from source
Sourcefn save<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 Self::Config,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 Self::Config,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Save configuration to source
Provided Methods§
Sourcefn watch_changes<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<Self::Config>> + Send + 'static>>>> + Send + 'async_trait>>where
Self::Config: 'static,
Self: 'async_trait,
'life0: 'async_trait,
fn watch_changes<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<Self::Config>> + Send + 'static>>>> + Send + 'async_trait>>where
Self::Config: 'static,
Self: 'async_trait,
'life0: 'async_trait,
Watch for configuration changes