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

客户端配置trait - 用于类型安全的客户端连接

Required Associated Types§

Required Methods§

Source

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

验证配置的正确性

Source

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

构建连接实例

Source

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

获取协议名称

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§