Skip to main content

OutboundDialer

Trait OutboundDialer 

Source
pub trait OutboundDialer: Send + Sync {
    // Required method
    fn dial<'life0, 'life1, 'async_trait>(
        &'life0 self,
        target: NodeId,
        addr: &'life1 str,
        options: ConnectionOptions,
    ) -> Pin<Box<dyn Future<Output = Result<Connection, ClientError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Outbound dialer the controller hands to the peer sender.

krabka-raft cannot depend on krabka-broker, because that would be a cycle. The broker therefore supplies an impl that wraps its InterBrokerClient, with TLS and SASL, and injects it through ControllerConfig::dialer. When no dialer is injected, the controller falls back to a plain Connection::connect(addr), which is the PLAINTEXT path.

Required Methods§

Source

fn dial<'life0, 'life1, 'async_trait>( &'life0 self, target: NodeId, addr: &'life1 str, options: ConnectionOptions, ) -> Pin<Box<dyn Future<Output = Result<Connection, ClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Opens a Connection to the raft peer target, which is reachable on addr. The returned connection has already negotiated ApiVersions, and raw_request can use it immediately.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§