1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
use crate::common::model::config::Config; use async_trait::async_trait; use tokio::sync::watch; #[async_trait] pub trait ConfigProvider: Send + Sync { /// Load the initial configuration async fn load_config(&self) -> Result<Config, String>; /// Watch for configuration changes. /// Returns a watch::Receiver that yields the latest Config. async fn watch(&self) -> Result<watch::Receiver<Config>, String>; } pub mod file;