36 lines
1.1 KiB
Rust
36 lines
1.1 KiB
Rust
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Future.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_future.rs`, see https://github.com/diwic/dbus-rs
|
|
use dbus;
|
|
use dbus::arg;
|
|
use dbus::tree;
|
|
|
|
pub trait ChannelFUTURE {
|
|
fn bundle(&self) -> Result<dbus::Path<'static>, tree::MethodErr>;
|
|
}
|
|
|
|
pub fn channel_future_server<F, T, D>(
|
|
factory: &tree::Factory<tree::MTFn<D>, D>,
|
|
data: D::Interface,
|
|
f: F,
|
|
) -> tree::Interface<tree::MTFn<D>, D>
|
|
where
|
|
D: tree::DataType,
|
|
D::Method: Default,
|
|
D::Property: Default,
|
|
T: ChannelFUTURE,
|
|
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
|
{
|
|
let i = factory.interface("org.freedesktop.Telepathy.Channel.FUTURE", data);
|
|
let f = ::std::sync::Arc::new(f);
|
|
let p = factory.property::<dbus::Path, _>("Bundle", Default::default());
|
|
let p = p.access(tree::Access::Read);
|
|
let fclone = f.clone();
|
|
let p = p.on_get(move |a, pinfo| {
|
|
let minfo = pinfo.to_method_info();
|
|
let d = fclone(&minfo);
|
|
a.append(d.bundle()?);
|
|
Ok(())
|
|
});
|
|
let i = i.add_p(p);
|
|
i
|
|
}
|