pub struct AppConfig {
pub core: CoreConfig,
pub routing: RoutingConfig,
pub profiles: Vec<ProfileConfig>,
pub probe: ProbeConfig,
pub notify: NotifyConfig,
}Fields§
§core: CoreConfig§routing: RoutingConfig§profiles: Vec<ProfileConfig>§probe: ProbeConfig§notify: NotifyConfigImplementations§
Source§impl AppConfig
impl AppConfig
Sourcepub async fn load_raw(path: &Path) -> Result<Self>
pub async fn load_raw(path: &Path) -> Result<Self>
Load and parse configuration from a YAML file without requiring non-empty profiles.
Sourcepub async fn load(path: &Path) -> Result<Self>
pub async fn load(path: &Path) -> Result<Self>
Load and validate configuration from a YAML file.
pub fn parse_yaml(raw: &str) -> Result<Self>
pub fn validate(&self) -> Result<()>
Sourcepub async fn save_atomic(&self, path: &Path) -> Result<()>
pub async fn save_atomic(&self, path: &Path) -> Result<()>
Atomically write configuration back to disk.
pub fn add_profile(&mut self, profile: ProfileConfig) -> Result<()>
pub fn remove_profile(&mut self, name: &str) -> Result<()>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AppConfig
impl<'de> Deserialize<'de> for AppConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Forget for AppConfig
impl Freeze for AppConfigwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<String>: Freeze,
PhantomData<ProfileConfig>: Freeze,
PhantomData<ProbeTarget>: Freeze,
impl Move for AppConfig
impl RefUnwindSafe for AppConfig
impl Send for AppConfigwhere
RawVecInner: Send,
impl Sync for AppConfigwhere
RawVecInner: Sync,
impl Unpin for AppConfig
impl UnsafeUnpin for AppConfigwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<ProfileConfig>: UnsafeUnpin,
PhantomData<ProbeTarget>: UnsafeUnpin,
impl UnwindSafe for AppConfigwhere
RawVecInner: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more