Use AsRefClosure when generating the bindings
This simplifies things significantly \o/
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Connection_Interface_Anonymity.xml -i org.freedesktop.Telepathy -o src/telepathy/connection_interface_anonymity.rs`, see https://github.com/diwic/dbus-rs
|
||||
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Connection_Interface_Anonymity.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/connection_interface_anonymity.rs`, see https://github.com/diwic/dbus-rs
|
||||
use dbus;
|
||||
use dbus::arg;
|
||||
use dbus::tree;
|
||||
@@ -21,8 +21,8 @@ where
|
||||
D::Method: Default,
|
||||
D::Property: Default,
|
||||
D::Signal: Default,
|
||||
T: ConnectionInterfaceAnonymity,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ConnectionInterfaceAnonymity>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface(
|
||||
"org.freedesktop.Telepathy.Connection.Interface.Anonymity",
|
||||
@@ -34,7 +34,8 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.supported_anonymity_modes()?);
|
||||
Ok(())
|
||||
});
|
||||
@@ -45,14 +46,16 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.anonymity_mandatory()?);
|
||||
Ok(())
|
||||
});
|
||||
let fclone = f.clone();
|
||||
let p = p.on_set(move |iter, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
d.set_anonymity_mandatory(iter.read()?)?;
|
||||
Ok(())
|
||||
});
|
||||
@@ -63,14 +66,16 @@ where
|
||||
let fclone = f.clone();
|
||||
let p = p.on_get(move |a, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
a.append(d.anonymity_modes()?);
|
||||
Ok(())
|
||||
});
|
||||
let fclone = f.clone();
|
||||
let p = p.on_set(move |iter, pinfo| {
|
||||
let minfo = pinfo.to_method_info();
|
||||
let d = fclone(&minfo);
|
||||
let dd = fclone(&minfo);
|
||||
let d = dd.as_ref();
|
||||
d.set_anonymity_modes(iter.read()?)?;
|
||||
Ok(())
|
||||
});
|
||||
|
Reference in New Issue
Block a user