Skip to main content

ClientConfig

Trait ClientConfig 

Source
pub trait ClientConfig:
    Send
    + Sync
    + 'static {
    type Connection: Connection;

    // Required methods
    fn validate(&self) -> Result<(), TransportError>;
    fn build_connection(
        &self,
    ) -> impl Future<Output = Result<Self::Connection, TransportError>> + Send;
    fn protocol_name(&self) -> &'static str;
}
Expand description

Client configuration trait - for type-safe client connections

Required Associated Types§

Required Methods§

Source

fn validate(&self) -> Result<(), TransportError>

Validate configuration correctness

Source

fn build_connection( &self, ) -> impl Future<Output = Result<Self::Connection, TransportError>> + Send

Build connection instance

Source

fn protocol_name(&self) -> &'static str

Get protocol name

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.

Implementors§