1 | // This code was autogenerated with `dbus-codegen-rust -d org.freedesktop.DBus -p /org/freedesktop/DBus -m none -c blocking -g -i org.freedesktop. --dbuscrate crate --interfaces DBus -o dbus/src/blocking/generated_org_freedesktop_dbus.rs`, see https://github.com/diwic/dbus-rs |
2 | use crate as dbus; |
3 | #[allow (unused_imports)] |
4 | use crate::arg; |
5 | use crate::blocking; |
6 | |
7 | pub trait DBus { |
8 | fn hello(&self) -> Result<String, dbus::Error>; |
9 | fn request_name(&self, arg0: &str, arg1: u32) -> Result<u32, dbus::Error>; |
10 | fn release_name(&self, arg0: &str) -> Result<u32, dbus::Error>; |
11 | fn start_service_by_name(&self, arg0: &str, arg1: u32) -> Result<u32, dbus::Error>; |
12 | fn update_activation_environment(&self, arg0: ::std::collections::HashMap<&str, &str>) -> Result<(), dbus::Error>; |
13 | fn name_has_owner(&self, arg0: &str) -> Result<bool, dbus::Error>; |
14 | fn list_names(&self) -> Result<Vec<String>, dbus::Error>; |
15 | fn list_activatable_names(&self) -> Result<Vec<String>, dbus::Error>; |
16 | fn add_match(&self, arg0: &str) -> Result<(), dbus::Error>; |
17 | fn remove_match(&self, arg0: &str) -> Result<(), dbus::Error>; |
18 | fn get_name_owner(&self, arg0: &str) -> Result<String, dbus::Error>; |
19 | fn list_queued_owners(&self, arg0: &str) -> Result<Vec<String>, dbus::Error>; |
20 | fn get_connection_unix_user(&self, arg0: &str) -> Result<u32, dbus::Error>; |
21 | fn get_connection_unix_process_id(&self, arg0: &str) -> Result<u32, dbus::Error>; |
22 | fn get_adt_audit_session_data(&self, arg0: &str) -> Result<Vec<u8>, dbus::Error>; |
23 | fn get_connection_selinux_security_context(&self, arg0: &str) -> Result<Vec<u8>, dbus::Error>; |
24 | fn reload_config(&self) -> Result<(), dbus::Error>; |
25 | fn get_id(&self) -> Result<String, dbus::Error>; |
26 | fn get_connection_credentials(&self, arg0: &str) -> Result<::std::collections::HashMap<String, arg::Variant<Box<dyn arg::RefArg + 'static>>>, dbus::Error>; |
27 | fn features(&self) -> Result<Vec<String>, dbus::Error>; |
28 | fn interfaces(&self) -> Result<Vec<String>, dbus::Error>; |
29 | } |
30 | |
31 | impl<'a, T: blocking::BlockingSender, C: ::std::ops::Deref<Target=T>> DBus for blocking::Proxy<'a, C> { |
32 | |
33 | fn hello(&self) -> Result<String, dbus::Error> { |
34 | self.method_call("org.freedesktop.DBus" , "Hello" , ()) |
35 | .and_then(|r: (String, )| Ok(r.0, )) |
36 | } |
37 | |
38 | fn request_name(&self, arg0: &str, arg1: u32) -> Result<u32, dbus::Error> { |
39 | self.method_call("org.freedesktop.DBus" , "RequestName" , (arg0, arg1, )) |
40 | .and_then(|r: (u32, )| Ok(r.0, )) |
41 | } |
42 | |
43 | fn release_name(&self, arg0: &str) -> Result<u32, dbus::Error> { |
44 | self.method_call("org.freedesktop.DBus" , "ReleaseName" , (arg0, )) |
45 | .and_then(|r: (u32, )| Ok(r.0, )) |
46 | } |
47 | |
48 | fn start_service_by_name(&self, arg0: &str, arg1: u32) -> Result<u32, dbus::Error> { |
49 | self.method_call("org.freedesktop.DBus" , "StartServiceByName" , (arg0, arg1, )) |
50 | .and_then(|r: (u32, )| Ok(r.0, )) |
51 | } |
52 | |
53 | fn update_activation_environment(&self, arg0: ::std::collections::HashMap<&str, &str>) -> Result<(), dbus::Error> { |
54 | self.method_call("org.freedesktop.DBus" , "UpdateActivationEnvironment" , (arg0, )) |
55 | } |
56 | |
57 | fn name_has_owner(&self, arg0: &str) -> Result<bool, dbus::Error> { |
58 | self.method_call("org.freedesktop.DBus" , "NameHasOwner" , (arg0, )) |
59 | .and_then(|r: (bool, )| Ok(r.0, )) |
60 | } |
61 | |
62 | fn list_names(&self) -> Result<Vec<String>, dbus::Error> { |
63 | self.method_call("org.freedesktop.DBus" , "ListNames" , ()) |
64 | .and_then(|r: (Vec<String>, )| Ok(r.0, )) |
65 | } |
66 | |
67 | fn list_activatable_names(&self) -> Result<Vec<String>, dbus::Error> { |
68 | self.method_call("org.freedesktop.DBus" , "ListActivatableNames" , ()) |
69 | .and_then(|r: (Vec<String>, )| Ok(r.0, )) |
70 | } |
71 | |
72 | fn add_match(&self, arg0: &str) -> Result<(), dbus::Error> { |
73 | self.method_call("org.freedesktop.DBus" , "AddMatch" , (arg0, )) |
74 | } |
75 | |
76 | fn remove_match(&self, arg0: &str) -> Result<(), dbus::Error> { |
77 | self.method_call("org.freedesktop.DBus" , "RemoveMatch" , (arg0, )) |
78 | } |
79 | |
80 | fn get_name_owner(&self, arg0: &str) -> Result<String, dbus::Error> { |
81 | self.method_call("org.freedesktop.DBus" , "GetNameOwner" , (arg0, )) |
82 | .and_then(|r: (String, )| Ok(r.0, )) |
83 | } |
84 | |
85 | fn list_queued_owners(&self, arg0: &str) -> Result<Vec<String>, dbus::Error> { |
86 | self.method_call("org.freedesktop.DBus" , "ListQueuedOwners" , (arg0, )) |
87 | .and_then(|r: (Vec<String>, )| Ok(r.0, )) |
88 | } |
89 | |
90 | fn get_connection_unix_user(&self, arg0: &str) -> Result<u32, dbus::Error> { |
91 | self.method_call("org.freedesktop.DBus" , "GetConnectionUnixUser" , (arg0, )) |
92 | .and_then(|r: (u32, )| Ok(r.0, )) |
93 | } |
94 | |
95 | fn get_connection_unix_process_id(&self, arg0: &str) -> Result<u32, dbus::Error> { |
96 | self.method_call("org.freedesktop.DBus" , "GetConnectionUnixProcessID" , (arg0, )) |
97 | .and_then(|r: (u32, )| Ok(r.0, )) |
98 | } |
99 | |
100 | fn get_adt_audit_session_data(&self, arg0: &str) -> Result<Vec<u8>, dbus::Error> { |
101 | self.method_call("org.freedesktop.DBus" , "GetAdtAuditSessionData" , (arg0, )) |
102 | .and_then(|r: (Vec<u8>, )| Ok(r.0, )) |
103 | } |
104 | |
105 | fn get_connection_selinux_security_context(&self, arg0: &str) -> Result<Vec<u8>, dbus::Error> { |
106 | self.method_call("org.freedesktop.DBus" , "GetConnectionSELinuxSecurityContext" , (arg0, )) |
107 | .and_then(|r: (Vec<u8>, )| Ok(r.0, )) |
108 | } |
109 | |
110 | fn reload_config(&self) -> Result<(), dbus::Error> { |
111 | self.method_call("org.freedesktop.DBus" , "ReloadConfig" , ()) |
112 | } |
113 | |
114 | fn get_id(&self) -> Result<String, dbus::Error> { |
115 | self.method_call("org.freedesktop.DBus" , "GetId" , ()) |
116 | .and_then(|r: (String, )| Ok(r.0, )) |
117 | } |
118 | |
119 | fn get_connection_credentials(&self, arg0: &str) -> Result<::std::collections::HashMap<String, arg::Variant<Box<dyn arg::RefArg + 'static>>>, dbus::Error> { |
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 | |
124 | fn features(&self) -> Result<Vec<String>, dbus::Error> { |
125 | <Self as blocking::stdintf::org_freedesktop_dbus::Properties>::get(&self, "org.freedesktop.DBus" , "Features" ) |
126 | } |
127 | |
128 | fn interfaces(&self) -> Result<Vec<String>, dbus::Error> { |
129 | <Self as blocking::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 { |
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 { |
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 { |
169 | fn append(&self, i: &mut arg::IterAppend) { |
170 | arg::RefArg::append(&self.arg0, i); |
171 | } |
172 | } |
173 | |
174 | impl arg::ReadAll for DBusNameLost { |
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 { |
193 | fn append(&self, i: &mut arg::IterAppend) { |
194 | arg::RefArg::append(&self.arg0, i); |
195 | } |
196 | } |
197 | |
198 | impl arg::ReadAll for DBusNameAcquired { |
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 | |