pub trait ConfigReloader: Send + Sync {
// Required methods
fn source_label(&self) -> String;
fn maybe_reload<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<ConfigState>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn reload_now<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ConfigState>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Required Methods§
Sourcefn source_label(&self) -> String
fn source_label(&self) -> String
Human-readable description of where config is loaded from, for logs.
Sourcefn maybe_reload<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<ConfigState>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn maybe_reload<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<ConfigState>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Return a freshly loaded state if a reload is needed; otherwise, return None.
Sourcefn reload_now<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ConfigState>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn reload_now<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ConfigState>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Force a reload, regardless of whether a change was detected.