Make settings serializable
This commit is contained in:
parent
54a9f4d6f3
commit
737b687bd3
2 changed files with 3 additions and 1 deletions
|
|
@ -7,6 +7,7 @@ license = "MPL-2.0"
|
||||||
[dependencies]
|
[dependencies]
|
||||||
bitflags = "1.3.2"
|
bitflags = "1.3.2"
|
||||||
derive_builder = "0.10.2"
|
derive_builder = "0.10.2"
|
||||||
|
serde = { version = "1.0.134", features = ["derive"] }
|
||||||
zbus = "2.0.1"
|
zbus = "2.0.1"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
|
|
||||||
|
|
@ -22,10 +22,11 @@ impl<'a> From<ConnectionSettingsProxy<'a>> for Connection<'a> {
|
||||||
|
|
||||||
macro_rules! derive_value_build {
|
macro_rules! derive_value_build {
|
||||||
($name:ident, $(($arg:ident: $arg_ty:ty)),*) => {
|
($name:ident, $(($arg:ident: $arg_ty:ty)),*) => {
|
||||||
#[derive(Builder)]
|
#[derive(Builder, serde::Deserialize, serde::Serialize)]
|
||||||
pub struct $name {
|
pub struct $name {
|
||||||
$(
|
$(
|
||||||
#[builder(setter(into, strip_option))]
|
#[builder(setter(into, strip_option))]
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
$arg: Option<$arg_ty>,
|
$arg: Option<$arg_ty>,
|
||||||
)*
|
)*
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue