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§
type Connection: Connection
Required Methods§
Sourcefn validate(&self) -> Result<(), TransportError>
fn validate(&self) -> Result<(), TransportError>
Validate configuration correctness
Sourcefn build_connection(
&self,
) -> impl Future<Output = Result<Self::Connection, TransportError>> + Send
fn build_connection( &self, ) -> impl Future<Output = Result<Self::Connection, TransportError>> + Send
Build connection instance
Sourcefn protocol_name(&self) -> &'static str
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.