Files
telepathy-padfoot/src/telepathy/channel_bundle.rs
Nick Thomas 3d44ce6b3d Initial checkin
This commit contains autogenerated telepathy DBUS code and the output
of `cargo new telepathy-delta`. It's pretty chill.
2020-05-08 20:38:30 +01:00

36 lines
1.1 KiB
Rust

// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Bundle.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_bundle.rs`, see https://github.com/diwic/dbus-rs
use dbus;
use dbus::arg;
use dbus::tree;
pub trait ChannelBundleDRAFT {
fn interfaces(&self) -> Result<Vec<String>, tree::MethodErr>;
}
pub fn channel_bundle_draft_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: ChannelBundleDRAFT,
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
{
let i = factory.interface("org.freedesktop.Telepathy.ChannelBundle.DRAFT", data);
let f = ::std::sync::Arc::new(f);
let p = factory.property::<Vec<&str>, _>("Interfaces", 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.interfaces()?);
Ok(())
});
let i = i.add_p(p);
i
}