Skip to main content

TransportClient

Trait TransportClient 

Source
pub trait TransportClient: Send + Sized {
    // Required methods
    fn with_uri(uri: Uri, pool: &ConnectionPool) -> Result<Self, TransportError>;
    fn with_uri_and_settings(
        uri: Uri,
        settings: &AppliedRequestSettings,
        pool: &ConnectionPool,
    ) -> Result<Self, TransportError>;

    // Provided method
    fn with_uri_and_settings_and_generation(
        uri: Uri,
        settings: &AppliedRequestSettings,
        pool: &ConnectionPool,
    ) -> Result<(Self, u64), TransportError> { ... }
}
Expand description

Generic way to create a transport client from provided Uri.

Required Methods§

Source

fn with_uri(uri: Uri, pool: &ConnectionPool) -> Result<Self, TransportError>

Build client using node’s url.

Source

fn with_uri_and_settings( uri: Uri, settings: &AppliedRequestSettings, pool: &ConnectionPool, ) -> Result<Self, TransportError>

Build client using node’s url and AppliedRequestSettings.

Provided Methods§

Source

fn with_uri_and_settings_and_generation( uri: Uri, settings: &AppliedRequestSettings, pool: &ConnectionPool, ) -> Result<(Self, u64), TransportError>

Build client using node’s url and AppliedRequestSettings, together with the pool generation of the connection it took (see ConnectionPool::generation). When an attempt misses its deadline, the executor evicts the node’s connections up to that generation.

The default reads the pool’s generation after building the client, so it can also cover a connection another thread pooled in between. Clients that take their connection from pool override it with the generation ConnectionPool::get_or_create_with_generation returns.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§