pub struct Config {
pub server: ServerConfig,
pub cache: CacheConfig,
pub layers: Vec<LayerConfig>,
pub metadata: MetadataConfig,
}Expand description
Complete server configuration
Fields§
§server: ServerConfigServer settings
cache: CacheConfigCache settings
layers: Vec<LayerConfig>Layer definitions
metadata: MetadataConfigGlobal metadata
Implementations§
Source§impl Config
impl Config
Sourcepub fn from_file<P: AsRef<Path>>(path: P) -> ConfigResult<Self>
pub fn from_file<P: AsRef<Path>>(path: P) -> ConfigResult<Self>
Load configuration from TOML file
Sourcepub fn from_toml(toml: &str) -> ConfigResult<Self>
pub fn from_toml(toml: &str) -> ConfigResult<Self>
Parse configuration from TOML string
Sourcepub fn default_config() -> Self
pub fn default_config() -> Self
Create a default configuration
Sourcepub fn validate(&self) -> ConfigResult<()>
pub fn validate(&self) -> ConfigResult<()>
Validate the configuration
Sourcepub fn get_layer(&self, name: &str) -> ConfigResult<&LayerConfig>
pub fn get_layer(&self, name: &str) -> ConfigResult<&LayerConfig>
Get a layer by name
Sourcepub fn enabled_layers(&self) -> impl Iterator<Item = &LayerConfig>
pub fn enabled_layers(&self) -> impl Iterator<Item = &LayerConfig>
Get all enabled layers
Sourcepub fn bind_address(&self) -> String
pub fn bind_address(&self) -> String
Get server bind address
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
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 Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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