pub trait ConfigSource: Send + Sync {
// Required methods
fn load<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ConfigValue>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn name(&self) -> &str;
// Provided methods
fn supports_watching(&self) -> bool { ... }
fn start_watching<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Receiver<ConfigValue>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}
Expand description
Trait for configuration sources
Required Methods§
Provided Methods§
Sourcefn supports_watching(&self) -> bool
fn supports_watching(&self) -> bool
Check if this source supports watching for changes
Sourcefn start_watching<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Receiver<ConfigValue>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn start_watching<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Receiver<ConfigValue>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Start watching for changes (if supported)