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_Contact_Blocking.xml -i org.freedesktop.Telepathy -o src/telepathy/connection_interface_contact_blocking.rs`, see https://github.com/diwic/dbus-rs
|
||||
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Connection_Interface_Contact_Blocking.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/connection_interface_contact_blocking.rs`, see https://github.com/diwic/dbus-rs
|
||||
use dbus;
|
||||
use dbus::arg;
|
||||
use dbus::tree;
|
||||
@@ -26,8 +26,8 @@ where
|
||||
D::Method: Default,
|
||||
D::Property: Default,
|
||||
D::Signal: Default,
|
||||
T: ConnectionInterfaceContactBlocking,
|
||||
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
||||
T: AsRef<dyn ConnectionInterfaceContactBlocking>,
|
||||
F: 'static + Fn(&tree::MethodInfo<tree::MTFn<D>, D>) -> T,
|
||||
{
|
||||
let i = factory.interface(
|
||||
"org.freedesktop.Telepathy.Connection.Interface.ContactBlocking",
|
||||
@@ -39,7 +39,8 @@ where
|
||||
let mut i = minfo.msg.iter_init();
|
||||
let contacts: Vec<u32> = i.read()?;
|
||||
let report_abusive: bool = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.block_contacts(contacts, report_abusive)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -53,7 +54,8 @@ where
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let mut i = minfo.msg.iter_init();
|
||||
let contacts: Vec<u32> = i.read()?;
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
d.unblock_contacts(contacts)?;
|
||||
let rm = minfo.msg.method_return();
|
||||
Ok(vec![rm])
|
||||
@@ -64,7 +66,8 @@ where
|
||||
|
||||
let fclone = f.clone();
|
||||
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
||||
let d = fclone(minfo);
|
||||
let dd = fclone(minfo);
|
||||
let d = dd.as_ref();
|
||||
let contacts = d.request_blocked_contacts()?;
|
||||
let rm = minfo.msg.method_return();
|
||||
let rm = rm.append1(contacts);
|
||||
@@ -79,7 +82,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.contact_blocking_capabilities()?);
|
||||
Ok(())
|
||||
});
|
||||
|
Reference in New Issue
Block a user