Skip to main content

cargo_move/
config.rs

1//! CargoMove Config
2//!
3//! See instructions in `commands.rs` to specify the path to your
4//! application's configuration file and/or command-line options
5//! for specifying it.
6
7use abscissa_core::Config;
8use serde::{Deserialize, Serialize};
9
10/// CargoMove Configuration
11#[derive(Clone, Config, Debug, Deserialize, Serialize)]
12#[serde(deny_unknown_fields)]
13pub struct CargoMoveConfig {
14    /// An example configuration section
15    pub hello: ExampleSection,
16}
17
18/// Default configuration settings.
19///
20/// Note: if your needs are as simple as below, you can
21/// use `#[derive(Default)]` on CargoMoveConfig instead.
22impl Default for CargoMoveConfig {
23    fn default() -> Self {
24        Self {
25            hello: ExampleSection::default(),
26        }
27    }
28}
29
30/// Example configuration section.
31///
32/// Delete this and replace it with your actual configuration structs.
33#[derive(Clone, Debug, Deserialize, Serialize)]
34#[serde(deny_unknown_fields)]
35pub struct ExampleSection {
36    /// Example configuration value
37    pub recipient: String,
38}
39
40impl Default for ExampleSection {
41    fn default() -> Self {
42        Self {
43            recipient: "world".to_owned(),
44        }
45    }
46}