Add a Settings type for all connection settings, and change bindings to use said type.

This commit is contained in:
Lucy 2022-01-21 10:50:31 -05:00
parent 737b687bd3
commit e660731756
No known key found for this signature in database
GPG key ID: EBC517FAD666BBF1
3 changed files with 71 additions and 91 deletions

View file

@ -20,6 +20,7 @@
//!
//! …consequently `zbus-xmlgen` did not generate code for the above interfaces.
use crate::settings::connection::Settings;
use zbus::dbus_proxy;
#[dbus_proxy(
@ -45,46 +46,24 @@ pub trait ConnectionSettings {
>;
/// GetSettings method
fn get_settings(
&self,
) -> zbus::Result<
std::collections::HashMap<
String,
std::collections::HashMap<String, zbus::zvariant::OwnedValue>,
>,
>;
fn get_settings(&self) -> zbus::Result<Settings>;
/// Save method
fn save(&self) -> zbus::Result<()>;
/// Update method
fn update(
&self,
properties: std::collections::HashMap<
&str,
std::collections::HashMap<&str, zbus::zvariant::Value<'_>>,
>,
) -> zbus::Result<()>;
fn update(&self, properties: &Settings) -> zbus::Result<()>;
/// Update2 method
fn update2(
&self,
settings: std::collections::HashMap<
&str,
std::collections::HashMap<&str, zbus::zvariant::Value<'_>>,
>,
settings: &Settings,
flags: u32,
args: std::collections::HashMap<&str, zbus::zvariant::Value<'_>>,
) -> zbus::Result<std::collections::HashMap<String, zbus::zvariant::OwnedValue>>;
/// UpdateUnsaved method
fn update_unsaved(
&self,
properties: std::collections::HashMap<
&str,
std::collections::HashMap<&str, zbus::zvariant::Value<'_>>,
>,
) -> zbus::Result<()>;
fn update_unsaved(&self, properties: &Settings) -> zbus::Result<()>;
/// Removed signal
#[dbus_proxy(signal)]