Skip to content

Commit

Permalink
Merge pull request #467 from AldanTanneo/refresh-generated-code
Browse files Browse the repository at this point in the history
Refresh generated code
  • Loading branch information
diwic authored May 28, 2024
2 parents 6ba9b82 + 901d3cf commit 22a8f88
Show file tree
Hide file tree
Showing 6 changed files with 220 additions and 218 deletions.
1 change: 1 addition & 0 deletions dbus/src/blocking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use crate::filters::Filters;

#[allow(missing_docs)]
mod generated_org_freedesktop_standard_interfaces;
#[allow(dead_code)]
mod generated_org_freedesktop_dbus;

/// This module contains some standard interfaces and an easy way to call them.
Expand Down
166 changes: 83 additions & 83 deletions dbus/src/blocking/generated_org_freedesktop_dbus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,89 @@ pub trait DBus {
fn get_connection_selinux_security_context(&self, arg0: &str) -> Result<Vec<u8>, dbus::Error>;
fn reload_config(&self) -> Result<(), dbus::Error>;
fn get_id(&self) -> Result<String, dbus::Error>;
fn get_connection_credentials(&self, arg0: &str) -> Result<::std::collections::HashMap<String, arg::Variant<Box<dyn arg::RefArg + 'static>>>, dbus::Error>;
fn get_connection_credentials(&self, arg0: &str) -> Result<arg::PropMap, dbus::Error>;
fn features(&self) -> Result<Vec<String>, dbus::Error>;
fn interfaces(&self) -> Result<Vec<String>, dbus::Error>;
}

#[derive(Debug)]
pub struct DBusNameOwnerChanged {
pub arg0: String,
pub arg1: String,
pub arg2: String,
}

impl arg::AppendAll for DBusNameOwnerChanged {
fn append(&self, i: &mut arg::IterAppend) {
arg::RefArg::append(&self.arg0, i);
arg::RefArg::append(&self.arg1, i);
arg::RefArg::append(&self.arg2, i);
}
}

impl arg::ReadAll for DBusNameOwnerChanged {
fn read(i: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError> {
Ok(DBusNameOwnerChanged {
arg0: i.read()?,
arg1: i.read()?,
arg2: i.read()?,
})
}
}

impl dbus::message::SignalArgs for DBusNameOwnerChanged {
const NAME: &'static str = "NameOwnerChanged";
const INTERFACE: &'static str = "org.freedesktop.DBus";
}

#[derive(Debug)]
pub struct DBusNameLost {
pub arg0: String,
}

impl arg::AppendAll for DBusNameLost {
fn append(&self, i: &mut arg::IterAppend) {
arg::RefArg::append(&self.arg0, i);
}
}

impl arg::ReadAll for DBusNameLost {
fn read(i: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError> {
Ok(DBusNameLost {
arg0: i.read()?,
})
}
}

impl dbus::message::SignalArgs for DBusNameLost {
const NAME: &'static str = "NameLost";
const INTERFACE: &'static str = "org.freedesktop.DBus";
}

#[derive(Debug)]
pub struct DBusNameAcquired {
pub arg0: String,
}

impl arg::AppendAll for DBusNameAcquired {
fn append(&self, i: &mut arg::IterAppend) {
arg::RefArg::append(&self.arg0, i);
}
}

impl arg::ReadAll for DBusNameAcquired {
fn read(i: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError> {
Ok(DBusNameAcquired {
arg0: i.read()?,
})
}
}

impl dbus::message::SignalArgs for DBusNameAcquired {
const NAME: &'static str = "NameAcquired";
const INTERFACE: &'static str = "org.freedesktop.DBus";
}

impl<'a, T: blocking::BlockingSender, C: ::std::ops::Deref<Target=T>> DBus for blocking::Proxy<'a, C> {

fn hello(&self) -> Result<String, dbus::Error> {
Expand Down Expand Up @@ -116,94 +194,16 @@ impl<'a, T: blocking::BlockingSender, C: ::std::ops::Deref<Target=T>> DBus for b
.and_then(|r: (String, )| Ok(r.0, ))
}

fn get_connection_credentials(&self, arg0: &str) -> Result<::std::collections::HashMap<String, arg::Variant<Box<dyn arg::RefArg + 'static>>>, dbus::Error> {
fn get_connection_credentials(&self, arg0: &str) -> Result<arg::PropMap, dbus::Error> {
self.method_call("org.freedesktop.DBus", "GetConnectionCredentials", (arg0, ))
.and_then(|r: (::std::collections::HashMap<String, arg::Variant<Box<dyn arg::RefArg + 'static>>>, )| Ok(r.0, ))
.and_then(|r: (arg::PropMap, )| Ok(r.0, ))
}

fn features(&self) -> Result<Vec<String>, dbus::Error> {
<Self as blocking::stdintf::org_freedesktop_dbus::Properties>::get(&self, "org.freedesktop.DBus", "Features")
<Self as blocking::stdintf::org_freedesktop_dbus::Properties>::get(self, "org.freedesktop.DBus", "Features")
}

fn interfaces(&self) -> Result<Vec<String>, dbus::Error> {
<Self as blocking::stdintf::org_freedesktop_dbus::Properties>::get(&self, "org.freedesktop.DBus", "Interfaces")
<Self as blocking::stdintf::org_freedesktop_dbus::Properties>::get(self, "org.freedesktop.DBus", "Interfaces")
}
}

#[derive(Debug)]
pub struct DBusNameOwnerChanged {
pub arg0: String,
pub arg1: String,
pub arg2: String,
}

impl arg::AppendAll for DBusNameOwnerChanged {
fn append(&self, i: &mut arg::IterAppend) {
arg::RefArg::append(&self.arg0, i);
arg::RefArg::append(&self.arg1, i);
arg::RefArg::append(&self.arg2, i);
}
}

impl arg::ReadAll for DBusNameOwnerChanged {
fn read(i: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError> {
Ok(DBusNameOwnerChanged {
arg0: i.read()?,
arg1: i.read()?,
arg2: i.read()?,
})
}
}

impl dbus::message::SignalArgs for DBusNameOwnerChanged {
const NAME: &'static str = "NameOwnerChanged";
const INTERFACE: &'static str = "org.freedesktop.DBus";
}

#[derive(Debug)]
pub struct DBusNameLost {
pub arg0: String,
}

impl arg::AppendAll for DBusNameLost {
fn append(&self, i: &mut arg::IterAppend) {
arg::RefArg::append(&self.arg0, i);
}
}

impl arg::ReadAll for DBusNameLost {
fn read(i: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError> {
Ok(DBusNameLost {
arg0: i.read()?,
})
}
}

impl dbus::message::SignalArgs for DBusNameLost {
const NAME: &'static str = "NameLost";
const INTERFACE: &'static str = "org.freedesktop.DBus";
}

#[derive(Debug)]
pub struct DBusNameAcquired {
pub arg0: String,
}

impl arg::AppendAll for DBusNameAcquired {
fn append(&self, i: &mut arg::IterAppend) {
arg::RefArg::append(&self.arg0, i);
}
}

impl arg::ReadAll for DBusNameAcquired {
fn read(i: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError> {
Ok(DBusNameAcquired {
arg0: i.read()?,
})
}
}

impl dbus::message::SignalArgs for DBusNameAcquired {
const NAME: &'static str = "NameAcquired";
const INTERFACE: &'static str = "org.freedesktop.DBus";
}
50 changes: 25 additions & 25 deletions dbus/src/blocking/generated_org_freedesktop_standard_interfaces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,6 @@ pub trait Properties {
fn set<I2: arg::Arg + arg::Append>(&self, interface_name: &str, property_name: &str, value: I2) -> Result<(), dbus::Error>;
}

impl<'a, T: blocking::BlockingSender, C: ::std::ops::Deref<Target=T>> Properties for blocking::Proxy<'a, C> {

fn get<R0: for<'b> arg::Get<'b> + 'static>(&self, interface_name: &str, property_name: &str) -> Result<R0, dbus::Error> {
self.method_call("org.freedesktop.DBus.Properties", "Get", (interface_name, property_name, ))
.and_then(|r: (arg::Variant<R0>, )| Ok((r.0).0, ))
}

fn get_all(&self, interface_name: &str) -> Result<arg::PropMap, dbus::Error> {
self.method_call("org.freedesktop.DBus.Properties", "GetAll", (interface_name, ))
.and_then(|r: (arg::PropMap, )| Ok(r.0, ))
}

fn set<I2: arg::Arg + arg::Append>(&self, interface_name: &str, property_name: &str, value: I2) -> Result<(), dbus::Error> {
self.method_call("org.freedesktop.DBus.Properties", "Set", (interface_name, property_name, arg::Variant(value), ))
}
}

#[derive(Debug)]
pub struct PropertiesPropertiesChanged {
pub interface_name: String,
Expand Down Expand Up @@ -57,6 +40,23 @@ impl dbus::message::SignalArgs for PropertiesPropertiesChanged {
const INTERFACE: &'static str = "org.freedesktop.DBus.Properties";
}

impl<'a, T: blocking::BlockingSender, C: ::std::ops::Deref<Target=T>> Properties for blocking::Proxy<'a, C> {

fn get<R0: for<'b> arg::Get<'b> + 'static>(&self, interface_name: &str, property_name: &str) -> Result<R0, dbus::Error> {
self.method_call("org.freedesktop.DBus.Properties", "Get", (interface_name, property_name, ))
.and_then(|r: (arg::Variant<R0>, )| Ok((r.0).0, ))
}

fn get_all(&self, interface_name: &str) -> Result<arg::PropMap, dbus::Error> {
self.method_call("org.freedesktop.DBus.Properties", "GetAll", (interface_name, ))
.and_then(|r: (arg::PropMap, )| Ok(r.0, ))
}

fn set<I2: arg::Arg + arg::Append>(&self, interface_name: &str, property_name: &str, value: I2) -> Result<(), dbus::Error> {
self.method_call("org.freedesktop.DBus.Properties", "Set", (interface_name, property_name, arg::Variant(value), ))
}
}

pub trait Introspectable {
fn introspect(&self) -> Result<String, dbus::Error>;
}
Expand Down Expand Up @@ -90,14 +90,6 @@ pub trait ObjectManager {
fn get_managed_objects(&self) -> Result<::std::collections::HashMap<dbus::Path<'static>, ::std::collections::HashMap<String, arg::PropMap>>, dbus::Error>;
}

impl<'a, T: blocking::BlockingSender, C: ::std::ops::Deref<Target=T>> ObjectManager for blocking::Proxy<'a, C> {

fn get_managed_objects(&self) -> Result<::std::collections::HashMap<dbus::Path<'static>, ::std::collections::HashMap<String, arg::PropMap>>, dbus::Error> {
self.method_call("org.freedesktop.DBus.ObjectManager", "GetManagedObjects", ())
.and_then(|r: (::std::collections::HashMap<dbus::Path<'static>, ::std::collections::HashMap<String, arg::PropMap>>, )| Ok(r.0, ))
}
}

#[derive(Debug)]
pub struct ObjectManagerInterfacesAdded {
pub object: dbus::Path<'static>,
Expand Down Expand Up @@ -151,3 +143,11 @@ impl dbus::message::SignalArgs for ObjectManagerInterfacesRemoved {
const NAME: &'static str = "InterfacesRemoved";
const INTERFACE: &'static str = "org.freedesktop.DBus.ObjectManager";
}

impl<'a, T: blocking::BlockingSender, C: ::std::ops::Deref<Target=T>> ObjectManager for blocking::Proxy<'a, C> {

fn get_managed_objects(&self) -> Result<::std::collections::HashMap<dbus::Path<'static>, ::std::collections::HashMap<String, arg::PropMap>>, dbus::Error> {
self.method_call("org.freedesktop.DBus.ObjectManager", "GetManagedObjects", ())
.and_then(|r: (::std::collections::HashMap<dbus::Path<'static>, ::std::collections::HashMap<String, arg::PropMap>>, )| Ok(r.0, ))
}
}
1 change: 1 addition & 0 deletions dbus/src/nonblock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ use std::collections::HashMap;

#[allow(missing_docs)]
mod generated_org_freedesktop_standard_interfaces;
#[allow(dead_code)]
mod generated_org_freedesktop_dbus;


Expand Down
Loading

0 comments on commit 22a8f88

Please sign in to comment.