add yaml config support

This commit is contained in:
Toshit Chawda 2024-07-22 13:54:41 -07:00
parent 29f05a2ddd
commit 6bb5be5179
No known key found for this signature in database
GPG key ID: 91480ED99E2B3D9D
3 changed files with 24 additions and 0 deletions

View file

@ -242,6 +242,7 @@ impl Config {
Ok(match CLI.format {
ConfigFormat::Toml => toml::to_string_pretty(self)?,
ConfigFormat::Json => serde_json::to_string_pretty(self)?,
ConfigFormat::Yaml => serde_yaml::to_string(self)?,
})
}
@ -249,6 +250,7 @@ impl Config {
Ok(match CLI.format {
ConfigFormat::Toml => toml::from_str(&string)?,
ConfigFormat::Json => serde_json::from_str(&string)?,
ConfigFormat::Yaml => serde_yaml::from_str(&string)?,
})
}
}
@ -258,6 +260,7 @@ pub enum ConfigFormat {
#[default]
Toml,
Json,
Yaml,
}
/// Server implementation of the Wisp protocol in Rust, made for epoxy.