diff options
Diffstat (limited to 'src/pa_eq/dbus_api/server_lookup.rs')
-rw-r--r-- | src/pa_eq/dbus_api/server_lookup.rs | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/pa_eq/dbus_api/server_lookup.rs b/src/pa_eq/dbus_api/server_lookup.rs index 78ad4bd..8451024 100644 --- a/src/pa_eq/dbus_api/server_lookup.rs +++ b/src/pa_eq/dbus_api/server_lookup.rs | |||
@@ -34,7 +34,7 @@ where | |||
34 | let p = p.on_get(move |a, pinfo| { | 34 | let p = p.on_get(move |a, pinfo| { |
35 | let minfo = pinfo.to_method_info(); | 35 | let minfo = pinfo.to_method_info(); |
36 | let d = fclone(&minfo); | 36 | let d = fclone(&minfo); |
37 | a.append(try!(d.get_address())); | 37 | a.append(r#try!(d.get_address())); |
38 | Ok(()) | 38 | Ok(()) |
39 | }); | 39 | }); |
40 | let i = i.add_p(p); | 40 | let i = i.add_p(p); |
@@ -50,11 +50,11 @@ impl<'a, C: ::std::ops::Deref<Target=dbus::Connection>> OrgFreedesktopDBusIntros | |||
50 | type Err = dbus::Error; | 50 | type Err = dbus::Error; |
51 | 51 | ||
52 | fn introspect(&self) -> Result<String, Self::Err> { | 52 | fn introspect(&self) -> Result<String, Self::Err> { |
53 | let mut m = try!(self.method_call_with_args(&"org.freedesktop.DBus.Introspectable".into(), &"Introspect".into(), |_| { | 53 | let mut m = r#try!(self.method_call_with_args(&"org.freedesktop.DBus.Introspectable".into(), &"Introspect".into(), |_| { |
54 | })); | 54 | })); |
55 | try!(m.as_result()); | 55 | r#try!(m.as_result()); |
56 | let mut i = m.iter_init(); | 56 | let mut i = m.iter_init(); |
57 | let data: String = try!(i.read()); | 57 | let data: String = r#try!(i.read()); |
58 | Ok(data) | 58 | Ok(data) |
59 | } | 59 | } |
60 | } | 60 | } |
@@ -71,7 +71,7 @@ where | |||
71 | let fclone = f.clone(); | 71 | let fclone = f.clone(); |
72 | let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| { | 72 | let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| { |
73 | let d = fclone(minfo); | 73 | let d = fclone(minfo); |
74 | let data = try!(d.introspect()); | 74 | let data = r#try!(d.introspect()); |
75 | let rm = minfo.msg.method_return(); | 75 | let rm = minfo.msg.method_return(); |
76 | let rm = rm.append1(data); | 76 | let rm = rm.append1(data); |
77 | Ok(vec!(rm)) | 77 | Ok(vec!(rm)) |
@@ -93,36 +93,36 @@ impl<'a, C: ::std::ops::Deref<Target=dbus::Connection>> OrgFreedesktopDBusProper | |||
93 | type Err = dbus::Error; | 93 | type Err = dbus::Error; |
94 | 94 | ||
95 | fn get(&self, interface_name: &str, property_name: &str) -> Result<arg::Variant<Box<arg::RefArg>>, Self::Err> { | 95 | fn get(&self, interface_name: &str, property_name: &str) -> Result<arg::Variant<Box<arg::RefArg>>, Self::Err> { |
96 | let mut m = try!(self.method_call_with_args(&"org.freedesktop.DBus.Properties".into(), &"Get".into(), |msg| { | 96 | let mut m = r#try!(self.method_call_with_args(&"org.freedesktop.DBus.Properties".into(), &"Get".into(), |msg| { |
97 | let mut i = arg::IterAppend::new(msg); | 97 | let mut i = arg::IterAppend::new(msg); |
98 | i.append(interface_name); | 98 | i.append(interface_name); |
99 | i.append(property_name); | 99 | i.append(property_name); |
100 | })); | 100 | })); |
101 | try!(m.as_result()); | 101 | r#try!(m.as_result()); |
102 | let mut i = m.iter_init(); | 102 | let mut i = m.iter_init(); |
103 | let value: arg::Variant<Box<arg::RefArg>> = try!(i.read()); | 103 | let value: arg::Variant<Box<arg::RefArg>> = r#try!(i.read()); |
104 | Ok(value) | 104 | Ok(value) |
105 | } | 105 | } |
106 | 106 | ||
107 | fn set(&self, interface_name: &str, property_name: &str, value: arg::Variant<Box<arg::RefArg>>) -> Result<(), Self::Err> { | 107 | fn set(&self, interface_name: &str, property_name: &str, value: arg::Variant<Box<arg::RefArg>>) -> Result<(), Self::Err> { |
108 | let mut m = try!(self.method_call_with_args(&"org.freedesktop.DBus.Properties".into(), &"Set".into(), |msg| { | 108 | let mut m = r#try!(self.method_call_with_args(&"org.freedesktop.DBus.Properties".into(), &"Set".into(), |msg| { |
109 | let mut i = arg::IterAppend::new(msg); | 109 | let mut i = arg::IterAppend::new(msg); |
110 | i.append(interface_name); | 110 | i.append(interface_name); |
111 | i.append(property_name); | 111 | i.append(property_name); |
112 | i.append(value); | 112 | i.append(value); |
113 | })); | 113 | })); |
114 | try!(m.as_result()); | 114 | r#try!(m.as_result()); |
115 | Ok(()) | 115 | Ok(()) |
116 | } | 116 | } |
117 | 117 | ||
118 | fn get_all(&self, interface_name: &str) -> Result<::std::collections::HashMap<String, arg::Variant<Box<arg::RefArg>>>, Self::Err> { | 118 | fn get_all(&self, interface_name: &str) -> Result<::std::collections::HashMap<String, arg::Variant<Box<arg::RefArg>>>, Self::Err> { |
119 | let mut m = try!(self.method_call_with_args(&"org.freedesktop.DBus.Properties".into(), &"GetAll".into(), |msg| { | 119 | let mut m = r#try!(self.method_call_with_args(&"org.freedesktop.DBus.Properties".into(), &"GetAll".into(), |msg| { |
120 | let mut i = arg::IterAppend::new(msg); | 120 | let mut i = arg::IterAppend::new(msg); |
121 | i.append(interface_name); | 121 | i.append(interface_name); |
122 | })); | 122 | })); |
123 | try!(m.as_result()); | 123 | r#try!(m.as_result()); |
124 | let mut i = m.iter_init(); | 124 | let mut i = m.iter_init(); |
125 | let props: ::std::collections::HashMap<String, arg::Variant<Box<arg::RefArg>>> = try!(i.read()); | 125 | let props: ::std::collections::HashMap<String, arg::Variant<Box<arg::RefArg>>> = r#try!(i.read()); |
126 | Ok(props) | 126 | Ok(props) |
127 | } | 127 | } |
128 | } | 128 | } |
@@ -139,10 +139,10 @@ where | |||
139 | let fclone = f.clone(); | 139 | let fclone = f.clone(); |
140 | let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| { | 140 | let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| { |
141 | let mut i = minfo.msg.iter_init(); | 141 | let mut i = minfo.msg.iter_init(); |
142 | let interface_name: &str = try!(i.read()); | 142 | let interface_name: &str = r#try!(i.read()); |
143 | let property_name: &str = try!(i.read()); | 143 | let property_name: &str = r#try!(i.read()); |
144 | let d = fclone(minfo); | 144 | let d = fclone(minfo); |
145 | let value = try!(d.get(interface_name, property_name)); | 145 | let value = r#try!(d.get(interface_name, property_name)); |
146 | let rm = minfo.msg.method_return(); | 146 | let rm = minfo.msg.method_return(); |
147 | let rm = rm.append1(value); | 147 | let rm = rm.append1(value); |
148 | Ok(vec!(rm)) | 148 | Ok(vec!(rm)) |
@@ -156,11 +156,11 @@ where | |||
156 | let fclone = f.clone(); | 156 | let fclone = f.clone(); |
157 | let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| { | 157 | let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| { |
158 | let mut i = minfo.msg.iter_init(); | 158 | let mut i = minfo.msg.iter_init(); |
159 | let interface_name: &str = try!(i.read()); | 159 | let interface_name: &str = r#try!(i.read()); |
160 | let property_name: &str = try!(i.read()); | 160 | let property_name: &str = r#try!(i.read()); |
161 | let value: arg::Variant<Box<arg::RefArg>> = try!(i.read()); | 161 | let value: arg::Variant<Box<arg::RefArg>> = r#try!(i.read()); |
162 | let d = fclone(minfo); | 162 | let d = fclone(minfo); |
163 | try!(d.set(interface_name, property_name, value)); | 163 | r#try!(d.set(interface_name, property_name, value)); |
164 | let rm = minfo.msg.method_return(); | 164 | let rm = minfo.msg.method_return(); |
165 | Ok(vec!(rm)) | 165 | Ok(vec!(rm)) |
166 | }; | 166 | }; |
@@ -173,9 +173,9 @@ where | |||
173 | let fclone = f.clone(); | 173 | let fclone = f.clone(); |
174 | let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| { | 174 | let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| { |
175 | let mut i = minfo.msg.iter_init(); | 175 | let mut i = minfo.msg.iter_init(); |
176 | let interface_name: &str = try!(i.read()); | 176 | let interface_name: &str = r#try!(i.read()); |
177 | let d = fclone(minfo); | 177 | let d = fclone(minfo); |
178 | let props = try!(d.get_all(interface_name)); | 178 | let props = r#try!(d.get_all(interface_name)); |
179 | let rm = minfo.msg.method_return(); | 179 | let rm = minfo.msg.method_return(); |
180 | let rm = rm.append1(props); | 180 | let rm = rm.append1(props); |
181 | Ok(vec!(rm)) | 181 | Ok(vec!(rm)) |