Trait qrpc_sdk::ServiceConnector[][src]

pub trait ServiceConnector: Default {
#[must_use]    fn establish_connection<'async_trait>(
        self: Arc<Self>
    ) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>
    where
        Self: 'async_trait
;
#[must_use] fn terminate_connection<'async_trait>(
        self: Arc<Self>
    ) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>
    where
        Self: 'async_trait
; }

An external service that can be connected to

In order to use the function-set from an external service, your application needs to include it’s client-lib (usually named <service>-sdk) which provides a strongly typed API that abstracts away the RPC protocol logic.

Any service that should be connectable needs to implement this trait. Any service API object also needs to implement the Default trait so that the sdk internally can create a default of it, then call establish_connection() to fully initialise it.

Required methods

#[must_use]fn establish_connection<'async_trait>(
    self: Arc<Self>
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>> where
    Self: 'async_trait, 
[src]

Start a connection to the service backend

#[must_use]fn terminate_connection<'async_trait>(
    self: Arc<Self>
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>> where
    Self: 'async_trait, 
[src]

Terminate the connection to the service backend

Loading content...

Implementors

Loading content...