1 // This code was autogenerated with `dbus-codegen-rust -d org.freedesktop.DBus -p /org/freedesktop/DBus -m none -c nonblock -g -i org.freedesktop. --dbuscrate crate --filter DBus -o dbus/src/nonblock/generated_org_freedesktop_dbus.rs`, see https://github.com/diwic/dbus-rs
2 #![allow(missing_docs)]
3 use crate as dbus;
4 use crate::arg;
5 use crate::nonblock;
6 
7 pub trait DBus {
hello(&self) -> nonblock::MethodReply<String>8     fn hello(&self) -> nonblock::MethodReply<String>;
request_name(&self, arg0: &str, arg1: u32) -> nonblock::MethodReply<u32>9     fn request_name(&self, arg0: &str, arg1: u32) -> nonblock::MethodReply<u32>;
release_name(&self, arg0: &str) -> nonblock::MethodReply<u32>10     fn release_name(&self, arg0: &str) -> nonblock::MethodReply<u32>;
start_service_by_name(&self, arg0: &str, arg1: u32) -> nonblock::MethodReply<u32>11     fn start_service_by_name(&self, arg0: &str, arg1: u32) -> nonblock::MethodReply<u32>;
update_activation_environment(&self, arg0: ::std::collections::HashMap<&str, &str>) -> nonblock::MethodReply<()>12     fn update_activation_environment(&self, arg0: ::std::collections::HashMap<&str, &str>) -> nonblock::MethodReply<()>;
name_has_owner(&self, arg0: &str) -> nonblock::MethodReply<bool>13     fn name_has_owner(&self, arg0: &str) -> nonblock::MethodReply<bool>;
list_names(&self) -> nonblock::MethodReply<Vec<String>>14     fn list_names(&self) -> nonblock::MethodReply<Vec<String>>;
list_activatable_names(&self) -> nonblock::MethodReply<Vec<String>>15     fn list_activatable_names(&self) -> nonblock::MethodReply<Vec<String>>;
add_match(&self, arg0: &str) -> nonblock::MethodReply<()>16     fn add_match(&self, arg0: &str) -> nonblock::MethodReply<()>;
remove_match(&self, arg0: &str) -> nonblock::MethodReply<()>17     fn remove_match(&self, arg0: &str) -> nonblock::MethodReply<()>;
get_name_owner(&self, arg0: &str) -> nonblock::MethodReply<String>18     fn get_name_owner(&self, arg0: &str) -> nonblock::MethodReply<String>;
list_queued_owners(&self, arg0: &str) -> nonblock::MethodReply<Vec<String>>19     fn list_queued_owners(&self, arg0: &str) -> nonblock::MethodReply<Vec<String>>;
get_connection_unix_user(&self, arg0: &str) -> nonblock::MethodReply<u32>20     fn get_connection_unix_user(&self, arg0: &str) -> nonblock::MethodReply<u32>;
get_connection_unix_process_id(&self, arg0: &str) -> nonblock::MethodReply<u32>21     fn get_connection_unix_process_id(&self, arg0: &str) -> nonblock::MethodReply<u32>;
get_adt_audit_session_data(&self, arg0: &str) -> nonblock::MethodReply<Vec<u8>>22     fn get_adt_audit_session_data(&self, arg0: &str) -> nonblock::MethodReply<Vec<u8>>;
get_connection_selinux_security_context(&self, arg0: &str) -> nonblock::MethodReply<Vec<u8>>23     fn get_connection_selinux_security_context(&self, arg0: &str) -> nonblock::MethodReply<Vec<u8>>;
reload_config(&self) -> nonblock::MethodReply<()>24     fn reload_config(&self) -> nonblock::MethodReply<()>;
get_id(&self) -> nonblock::MethodReply<String>25     fn get_id(&self) -> nonblock::MethodReply<String>;
get_connection_credentials(&self, arg0: &str) -> nonblock::MethodReply<::std::collections::HashMap<String, arg::Variant<Box<dyn arg::RefArg + 'static>>>>26     fn get_connection_credentials(&self, arg0: &str) -> nonblock::MethodReply<::std::collections::HashMap<String, arg::Variant<Box<dyn arg::RefArg + 'static>>>>;
features(&self) -> nonblock::MethodReply<Vec<String>>27     fn features(&self) -> nonblock::MethodReply<Vec<String>>;
interfaces(&self) -> nonblock::MethodReply<Vec<String>>28     fn interfaces(&self) -> nonblock::MethodReply<Vec<String>>;
29 }
30 
31 impl<'a, T: nonblock::NonblockReply, C: ::std::ops::Deref<Target=T>> DBus for nonblock::Proxy<'a, C> {
32 
hello(&self) -> nonblock::MethodReply<String>33     fn hello(&self) -> nonblock::MethodReply<String> {
34         self.method_call("org.freedesktop.DBus", "Hello", ())
35             .and_then(|r: (String, )| Ok(r.0, ))
36     }
37 
request_name(&self, arg0: &str, arg1: u32) -> nonblock::MethodReply<u32>38     fn request_name(&self, arg0: &str, arg1: u32) -> nonblock::MethodReply<u32> {
39         self.method_call("org.freedesktop.DBus", "RequestName", (arg0, arg1, ))
40             .and_then(|r: (u32, )| Ok(r.0, ))
41     }
42 
release_name(&self, arg0: &str) -> nonblock::MethodReply<u32>43     fn release_name(&self, arg0: &str) -> nonblock::MethodReply<u32> {
44         self.method_call("org.freedesktop.DBus", "ReleaseName", (arg0, ))
45             .and_then(|r: (u32, )| Ok(r.0, ))
46     }
47 
start_service_by_name(&self, arg0: &str, arg1: u32) -> nonblock::MethodReply<u32>48     fn start_service_by_name(&self, arg0: &str, arg1: u32) -> nonblock::MethodReply<u32> {
49         self.method_call("org.freedesktop.DBus", "StartServiceByName", (arg0, arg1, ))
50             .and_then(|r: (u32, )| Ok(r.0, ))
51     }
52 
update_activation_environment(&self, arg0: ::std::collections::HashMap<&str, &str>) -> nonblock::MethodReply<()>53     fn update_activation_environment(&self, arg0: ::std::collections::HashMap<&str, &str>) -> nonblock::MethodReply<()> {
54         self.method_call("org.freedesktop.DBus", "UpdateActivationEnvironment", (arg0, ))
55     }
56 
name_has_owner(&self, arg0: &str) -> nonblock::MethodReply<bool>57     fn name_has_owner(&self, arg0: &str) -> nonblock::MethodReply<bool> {
58         self.method_call("org.freedesktop.DBus", "NameHasOwner", (arg0, ))
59             .and_then(|r: (bool, )| Ok(r.0, ))
60     }
61 
list_names(&self) -> nonblock::MethodReply<Vec<String>>62     fn list_names(&self) -> nonblock::MethodReply<Vec<String>> {
63         self.method_call("org.freedesktop.DBus", "ListNames", ())
64             .and_then(|r: (Vec<String>, )| Ok(r.0, ))
65     }
66 
list_activatable_names(&self) -> nonblock::MethodReply<Vec<String>>67     fn list_activatable_names(&self) -> nonblock::MethodReply<Vec<String>> {
68         self.method_call("org.freedesktop.DBus", "ListActivatableNames", ())
69             .and_then(|r: (Vec<String>, )| Ok(r.0, ))
70     }
71 
add_match(&self, arg0: &str) -> nonblock::MethodReply<()>72     fn add_match(&self, arg0: &str) -> nonblock::MethodReply<()> {
73         self.method_call("org.freedesktop.DBus", "AddMatch", (arg0, ))
74     }
75 
remove_match(&self, arg0: &str) -> nonblock::MethodReply<()>76     fn remove_match(&self, arg0: &str) -> nonblock::MethodReply<()> {
77         self.method_call("org.freedesktop.DBus", "RemoveMatch", (arg0, ))
78     }
79 
get_name_owner(&self, arg0: &str) -> nonblock::MethodReply<String>80     fn get_name_owner(&self, arg0: &str) -> nonblock::MethodReply<String> {
81         self.method_call("org.freedesktop.DBus", "GetNameOwner", (arg0, ))
82             .and_then(|r: (String, )| Ok(r.0, ))
83     }
84 
list_queued_owners(&self, arg0: &str) -> nonblock::MethodReply<Vec<String>>85     fn list_queued_owners(&self, arg0: &str) -> nonblock::MethodReply<Vec<String>> {
86         self.method_call("org.freedesktop.DBus", "ListQueuedOwners", (arg0, ))
87             .and_then(|r: (Vec<String>, )| Ok(r.0, ))
88     }
89 
get_connection_unix_user(&self, arg0: &str) -> nonblock::MethodReply<u32>90     fn get_connection_unix_user(&self, arg0: &str) -> nonblock::MethodReply<u32> {
91         self.method_call("org.freedesktop.DBus", "GetConnectionUnixUser", (arg0, ))
92             .and_then(|r: (u32, )| Ok(r.0, ))
93     }
94 
get_connection_unix_process_id(&self, arg0: &str) -> nonblock::MethodReply<u32>95     fn get_connection_unix_process_id(&self, arg0: &str) -> nonblock::MethodReply<u32> {
96         self.method_call("org.freedesktop.DBus", "GetConnectionUnixProcessID", (arg0, ))
97             .and_then(|r: (u32, )| Ok(r.0, ))
98     }
99 
get_adt_audit_session_data(&self, arg0: &str) -> nonblock::MethodReply<Vec<u8>>100     fn get_adt_audit_session_data(&self, arg0: &str) -> nonblock::MethodReply<Vec<u8>> {
101         self.method_call("org.freedesktop.DBus", "GetAdtAuditSessionData", (arg0, ))
102             .and_then(|r: (Vec<u8>, )| Ok(r.0, ))
103     }
104 
get_connection_selinux_security_context(&self, arg0: &str) -> nonblock::MethodReply<Vec<u8>>105     fn get_connection_selinux_security_context(&self, arg0: &str) -> nonblock::MethodReply<Vec<u8>> {
106         self.method_call("org.freedesktop.DBus", "GetConnectionSELinuxSecurityContext", (arg0, ))
107             .and_then(|r: (Vec<u8>, )| Ok(r.0, ))
108     }
109 
reload_config(&self) -> nonblock::MethodReply<()>110     fn reload_config(&self) -> nonblock::MethodReply<()> {
111         self.method_call("org.freedesktop.DBus", "ReloadConfig", ())
112     }
113 
get_id(&self) -> nonblock::MethodReply<String>114     fn get_id(&self) -> nonblock::MethodReply<String> {
115         self.method_call("org.freedesktop.DBus", "GetId", ())
116             .and_then(|r: (String, )| Ok(r.0, ))
117     }
118 
get_connection_credentials(&self, arg0: &str) -> nonblock::MethodReply<::std::collections::HashMap<String, arg::Variant<Box<dyn arg::RefArg + 'static>>>>119     fn get_connection_credentials(&self, arg0: &str) -> nonblock::MethodReply<::std::collections::HashMap<String, arg::Variant<Box<dyn arg::RefArg + 'static>>>> {
120         self.method_call("org.freedesktop.DBus", "GetConnectionCredentials", (arg0, ))
121             .and_then(|r: (::std::collections::HashMap<String, arg::Variant<Box<dyn arg::RefArg + 'static>>>, )| Ok(r.0, ))
122     }
123 
features(&self) -> nonblock::MethodReply<Vec<String>>124     fn features(&self) -> nonblock::MethodReply<Vec<String>> {
125         <Self as nonblock::stdintf::org_freedesktop_dbus::Properties>::get(&self, "org.freedesktop.DBus", "Features")
126     }
127 
interfaces(&self) -> nonblock::MethodReply<Vec<String>>128     fn interfaces(&self) -> nonblock::MethodReply<Vec<String>> {
129         <Self as nonblock::stdintf::org_freedesktop_dbus::Properties>::get(&self, "org.freedesktop.DBus", "Interfaces")
130     }
131 }
132 
133 #[derive(Debug)]
134 pub struct DBusNameOwnerChanged {
135     pub arg0: String,
136     pub arg1: String,
137     pub arg2: String,
138 }
139 
140 impl arg::AppendAll for DBusNameOwnerChanged {
append(&self, i: &mut arg::IterAppend)141     fn append(&self, i: &mut arg::IterAppend) {
142         arg::RefArg::append(&self.arg0, i);
143         arg::RefArg::append(&self.arg1, i);
144         arg::RefArg::append(&self.arg2, i);
145     }
146 }
147 
148 impl arg::ReadAll for DBusNameOwnerChanged {
read(i: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError>149     fn read(i: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError> {
150         Ok(DBusNameOwnerChanged {
151             arg0: i.read()?,
152             arg1: i.read()?,
153             arg2: i.read()?,
154         })
155     }
156 }
157 
158 impl dbus::message::SignalArgs for DBusNameOwnerChanged {
159     const NAME: &'static str = "NameOwnerChanged";
160     const INTERFACE: &'static str = "org.freedesktop.DBus";
161 }
162 
163 #[derive(Debug)]
164 pub struct DBusNameLost {
165     pub arg0: String,
166 }
167 
168 impl arg::AppendAll for DBusNameLost {
append(&self, i: &mut arg::IterAppend)169     fn append(&self, i: &mut arg::IterAppend) {
170         arg::RefArg::append(&self.arg0, i);
171     }
172 }
173 
174 impl arg::ReadAll for DBusNameLost {
read(i: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError>175     fn read(i: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError> {
176         Ok(DBusNameLost {
177             arg0: i.read()?,
178         })
179     }
180 }
181 
182 impl dbus::message::SignalArgs for DBusNameLost {
183     const NAME: &'static str = "NameLost";
184     const INTERFACE: &'static str = "org.freedesktop.DBus";
185 }
186 
187 #[derive(Debug)]
188 pub struct DBusNameAcquired {
189     pub arg0: String,
190 }
191 
192 impl arg::AppendAll for DBusNameAcquired {
append(&self, i: &mut arg::IterAppend)193     fn append(&self, i: &mut arg::IterAppend) {
194         arg::RefArg::append(&self.arg0, i);
195     }
196 }
197 
198 impl arg::ReadAll for DBusNameAcquired {
read(i: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError>199     fn read(i: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError> {
200         Ok(DBusNameAcquired {
201             arg0: i.read()?,
202         })
203     }
204 }
205 
206 impl dbus::message::SignalArgs for DBusNameAcquired {
207     const NAME: &'static str = "NameAcquired";
208     const INTERFACE: &'static str = "org.freedesktop.DBus";
209 }
210