Make settings serializable

This commit is contained in:
Lucy 2022-01-21 10:13:48 -05:00
parent 54a9f4d6f3
commit 737b687bd3
No known key found for this signature in database
GPG key ID: EBC517FAD666BBF1
2 changed files with 3 additions and 1 deletions

View file

@ -7,6 +7,7 @@ license = "MPL-2.0"
[dependencies]
bitflags = "1.3.2"
derive_builder = "0.10.2"
serde = { version = "1.0.134", features = ["derive"] }
zbus = "2.0.1"
[features]

View file

@ -22,10 +22,11 @@ impl<'a> From<ConnectionSettingsProxy<'a>> for Connection<'a> {
macro_rules! derive_value_build {
($name:ident, $(($arg:ident: $arg_ty:ty)),*) => {
#[derive(Builder)]
#[derive(Builder, serde::Deserialize, serde::Serialize)]
pub struct $name {
$(
#[builder(setter(into, strip_option))]
#[serde(skip_serializing_if = "Option::is_none")]
$arg: Option<$arg_ty>,
)*
}