Skip to main content

ConfigReloader

Trait ConfigReloader 

Source
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§

Source

fn source_label(&self) -> String

Human-readable description of where config is loaded from, for logs.

Source

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.

Source

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.

Implementors§