pzzld_server/config/
mod.rs

1/*
2    Appellation: cnf <module>
3    Contrib: FL03 <jo3mccain@icloud.com>
4*/
5//! # Configuration
6//!
7//! This module implements the configuration settings for the platform. It is composed of several
8//! sub-modules that define the various settings that can be configured.
9#[doc(inline)]
10pub use self::{kinds::*, settings::*, types::*};
11
12mod settings;
13
14pub mod kinds {
15    #[doc(inline)]
16    pub use self::{network::*, scope::*, services::*, tracing::*};
17
18    mod network;
19    mod scope;
20    mod services;
21    mod tracing;
22}
23
24pub mod types {
25    #[doc(inline)]
26    pub use self::{environment::*, log_level::*, mode::*, netaddr::*};
27
28    mod environment;
29    mod log_level;
30    mod mode;
31    mod netaddr;
32}
33
34pub(crate) mod prelude {
35    pub use super::kinds::*;
36    pub use super::settings::*;
37}
38
39serde_display! {
40    json::<Display>(
41        Settings,
42        TracingConfig,
43        NetworkConfig,
44        ServicesConfig
45    )
46}
47
48/// [`Configurable`] trait for types that can be configured with another type, denoted by
49/// [Configurable::Config].
50pub trait Configurable {
51    type Config;
52
53    fn config(&self) -> &Self::Config;
54}