Skip to main content

Rpc

Trait Rpc 

Source
pub trait Rpc {
    // Required methods
    fn client(&self) -> Arc<Mutex<dyn AsyncClient>> ;
    fn notify<'life0, 'life1, 'async_trait>(
        &'life0 self,
        target: &'life1 str,
        data: Cow<'async_trait>,
        qos: QoS,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Receiver<Result<(), Error>>>, Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn call0<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        target: &'life1 str,
        method: &'life2 str,
        params: Cow<'async_trait>,
        qos: QoS,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Receiver<Result<(), Error>>>, Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             Self: 'async_trait;
    fn call<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        target: &'life1 str,
        method: &'life2 str,
        params: Cow<'async_trait>,
        qos: QoS,
    ) -> Pin<Box<dyn Future<Output = Result<RpcEvent, RpcError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             Self: 'async_trait;
    fn is_connected(&self) -> bool;
}

Required Methods§

Source

fn client(&self) -> Arc<Mutex<dyn AsyncClient>>

When created, busrt client is wrapped with Arc<Mutex<_>> to let it be sent into the incoming frames handler future

This mehtod allows to get the containered-client back, to call its methods directly (manage pub/sub and send broadcast messages)

Source

fn notify<'life0, 'life1, 'async_trait>( &'life0 self, target: &'life1 str, data: Cow<'async_trait>, qos: QoS, ) -> Pin<Box<dyn Future<Output = Result<Option<Receiver<Result<(), Error>>>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Source

fn call0<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, target: &'life1 str, method: &'life2 str, params: Cow<'async_trait>, qos: QoS, ) -> Pin<Box<dyn Future<Output = Result<Option<Receiver<Result<(), Error>>>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Call the method, no response is required

Source

fn call<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, target: &'life1 str, method: &'life2 str, params: Cow<'async_trait>, qos: QoS, ) -> Pin<Box<dyn Future<Output = Result<RpcEvent, RpcError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Call the method and get the response

Source

fn is_connected(&self) -> bool

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§