47 lines
1.1 KiB
Rust
47 lines
1.1 KiB
Rust
|
//! Zebrad Config
|
||
|
//!
|
||
|
//! See instructions in `commands.rs` to specify the path to your
|
||
|
//! application's configuration file and/or command-line options
|
||
|
//! for specifying it.
|
||
|
|
||
|
use abscissa_core::Config;
|
||
|
use serde::{Deserialize, Serialize};
|
||
|
|
||
|
/// Zebrad Configuration
|
||
|
#[derive(Clone, Config, Debug, Deserialize, Serialize)]
|
||
|
#[serde(deny_unknown_fields)]
|
||
|
pub struct ZebradConfig {
|
||
|
/// An example configuration section
|
||
|
pub hello: ExampleSection,
|
||
|
}
|
||
|
|
||
|
/// Default configuration settings.
|
||
|
///
|
||
|
/// Note: if your needs are as simple as below, you can
|
||
|
/// use `#[derive(Default)]` on ZebradConfig instead.
|
||
|
impl Default for ZebradConfig {
|
||
|
fn default() -> Self {
|
||
|
Self {
|
||
|
hello: ExampleSection::default(),
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/// Example configuration section.
|
||
|
///
|
||
|
/// Delete this and replace it with your actual configuration structs.
|
||
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||
|
#[serde(deny_unknown_fields)]
|
||
|
pub struct ExampleSection {
|
||
|
/// Example configuration value
|
||
|
pub recipient: String,
|
||
|
}
|
||
|
|
||
|
impl Default for ExampleSection {
|
||
|
fn default() -> Self {
|
||
|
Self {
|
||
|
recipient: "world".to_owned(),
|
||
|
}
|
||
|
}
|
||
|
}
|