pub fn method_call<'i, 'm, R: ReadAll + 'static, A: AppendAll, I: Into<Interface<'i>>, M: Into<Member<'m>>>(
        &self,
        i: I,
        m: M,
        args: A,
    ) -> MethodReply<R> {
        let mut msg = Message::method_call(&self.destination, &self.path, &i.into(), &m.into());
        args.append(&mut IterAppend::new(&mut msg));

        let mr = Arc::new(Mutex::new(MRInner::Neither));
        let mr2 = mr.clone();
        let f = T::make_f(move |msg: Message, _: &T| {
            let mut inner = mr2.lock().unwrap();
            let old = mem::replace(&mut *inner, MRInner::Ready(Ok(msg)));
            if let MRInner::Pending(waker) = old {
                waker.wake()
            }
        });
        if let Err(_) = self.connection.send_with_reply(msg, f) {
            *mr.lock().unwrap() = MRInner::Ready(Err(Error::new_failed("Failed to send message")));
        }
        MethodReply(mr, Some(Box::new(|msg: Message| msg.read_all())))
    }
/// Make a method call using typed input argument, returns a future that resolves to the typed output arguments.
Make a method call using typed input argument, returns a future that resolves to the typed output arguments.
Make a method call using typed input argument returns a future that resolves to the typed output arguments .
pub fn method_call<'i, 'm, R: ReadAll + 'static, A: AppendAll, I: Into<Interface<'i>>, M: Into<Member<'m>>>(
        &self,
        i: I,
        m: M,
        args: A,
    ) -> MethodReply<R> {
        let mut msg = Message::method_call(&self.destination, &self.path, &i.into(), &m.into());
        args.append(&mut IterAppend::new(&mut msg));
        let mr = Arc::new(Mutex::new(MRInner::Neither));
        let mr2 = mr.clone();
        let f = T::make_f(move |msg: Message, _: &T| {
            let mut inner = mr2.lock().unwrap();
            let old = mem::replace(&mut *inner, MRInner::Ready(Ok(msg)));
            if let MRInner::Pending(waker) = old {
                waker.wake()
            }
        });
        if let Err(_) = self.connection.send_with_reply(msg, f) {
            *mr.lock().unwrap() = MRInner::Ready(Err(Error::new_failed("Failed to send message")));
        }
        MethodReply(mr, Some(Box::new(|msg: Message| msg.read_all())))
    }
pub fn method_call < ' i , ' m , R : ReadAll + ' static , A : AppendAll , I : Into < Interface < ' i > > , M : Into < Member < ' m > > > ( & self , i : I , m : M , args : A , ) -> MethodReply < R > { let mut msg = Message :: method_call ( & self . destination , & self . path , & i . into ( ) , & m . into ( ) ) ; args . append ( & mut IterAppend :: new ( & mut msg ) ) ; let mr = Arc :: new ( Mutex :: new ( MRInner :: Neither ) ) ; let mr2 = mr . clone ( ) ; let f = T :: make_f ( move | msg : Message , _ : & T | { let mut inner = mr2 . lock ( ) . unwrap ( ) ; let old = mem :: replace ( & mut * inner , MRInner :: Ready ( Ok ( msg ) ) ) ; if let MRInner :: Pending ( waker ) = old { waker . wake ( ) } } ) ; if let Err ( _ ) = self . connection . send_with_reply ( msg , f ) { * mr . lock ( ) . unwrap ( ) = MRInner :: Ready ( Err ( Error :: new_failed ( " " ) ) ) ; } MethodReply ( mr , Some ( Box :: new ( | msg : Message | msg . read_all ( ) ) ) ) }
Make a method call using typed input argument, returns a future that resolves to the typed output arguments.
Make a method call using typed input argument returns a future that resolves to the typed output arguments .
&self
i
I
m
M
args
A
&self
i
I
m
M
args
A