This commit contains autogenerated telepathy DBUS code and the output of `cargo new telepathy-delta`. It's pretty chill.
37 lines
1.2 KiB
Rust
37 lines
1.2 KiB
Rust
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Interface_Destroyable.xml -i org.freedesktop.Telepathy -o src/telepathy/channel_interface_destroyable.rs`, see https://github.com/diwic/dbus-rs
|
|
use dbus;
|
|
use dbus::arg;
|
|
use dbus::tree;
|
|
|
|
pub trait ChannelInterfaceDestroyable {
|
|
fn destroy(&self) -> Result<(), tree::MethodErr>;
|
|
}
|
|
|
|
pub fn channel_interface_destroyable_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,
|
|
T: ChannelInterfaceDestroyable,
|
|
F: 'static + for<'z> Fn(&'z tree::MethodInfo<tree::MTFn<D>, D>) -> &'z T,
|
|
{
|
|
let i = factory.interface(
|
|
"org.freedesktop.Telepathy.Channel.Interface.Destroyable",
|
|
data,
|
|
);
|
|
let f = ::std::sync::Arc::new(f);
|
|
let fclone = f.clone();
|
|
let h = move |minfo: &tree::MethodInfo<tree::MTFn<D>, D>| {
|
|
let d = fclone(minfo);
|
|
d.destroy()?;
|
|
let rm = minfo.msg.method_return();
|
|
Ok(vec![rm])
|
|
};
|
|
let m = factory.method("Destroy", Default::default(), h);
|
|
let i = i.add_m(m);
|
|
i
|
|
}
|