Use AsRefClosure when generating the bindings
This simplifies things significantly \o/
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user