Use AsRefClosure when generating the bindings

This simplifies things significantly \o/
This commit is contained in:
2020-05-11 00:48:18 +01:00
parent ad0d95ab40
commit 9151f64a6d
126 changed files with 1633 additions and 1054 deletions

View File

@@ -8,7 +8,8 @@ pub const PROTO_BUS_NAME: &'static str =
"org.freedesktop.Telepathy.ConnectionManager.padfoot.delta";
pub const PROTO_NAME: &'static str = "delta";
#[derive(Clone, Copy, Default, Debug)]
#[derive(Debug)]
pub struct Protocol {}
pub type Variant = arg::Variant<Box<dyn arg::RefArg + 'static>>;
@@ -74,6 +75,10 @@ pub fn requestables() -> Vec<RequestableChannelSpec> {
vec![(rf, ra)]
}
impl AsRef<dyn telepathy::Protocol + 'static> for std::rc::Rc<Protocol> {
fn as_ref(&self) -> &(dyn telepathy::Protocol + 'static) { &**self }
}
impl telepathy::Protocol for Protocol {
fn identify_account(&self, params: HashMap<&str, Variant>) -> Result<String, tree::MethodErr> {
println!("Protocol::identify_account({:?})", params);