pub trait ServiceConnector: Default {
// Required methods
fn establish_connection<'async_trait>(
self: Arc<Self>,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>
where Self: 'async_trait;
fn terminate_connection<'async_trait>(
self: Arc<Self>,
) -> Pin<Box<dyn Future<Output = RpcResult<()>> + Send + 'async_trait>>
where Self: 'async_trait;
}
Expand description
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§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.