2020-05-17 00:55:29 +01:00
#![ allow(clippy::all) ]
2020-05-11 00:48:18 +01:00
// This code was autogenerated with `dbus-codegen-rust --file telepathy-spec/spec/Channel_Future.xml -i org.freedesktop.Telepathy -a AsRefClosure -o src/telepathy/channel_future.rs`, see https://github.com/diwic/dbus-rs
2020-05-08 20:38:30 +01:00
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 ,
2020-05-11 00:48:18 +01:00
T : AsRef < dyn ChannelFUTURE > ,
F : 'static + Fn ( & tree ::MethodInfo < tree ::MTFn < D > , D > ) -> T ,
2020-05-08 20:38:30 +01:00
{
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 ( ) ;
2020-05-11 00:48:18 +01:00
let dd = fclone ( & minfo ) ;
let d = dd . as_ref ( ) ;
2020-05-08 20:38:30 +01:00
a . append ( d . bundle ( ) ? ) ;
Ok ( ( ) )
} ) ;
let i = i . add_p ( p ) ;
i
}