fn start_opening_connection(&self, shard: Option<Shard>) {
        let cfg = self.pool_config.connection_config.clone();
        let fut = match (self.sharder.clone(), self.shard_aware_port, shard) {
            (Some(sharder), Some(port), Some(shard)) => {
                let shard_aware_address = (self.address, port).into();
                async move {
                    let result = open_connection_to_shard_aware_port(
                        shard_aware_address,
                        shard,
                        sharder.clone(),
                        &cfg,
                    )
                    .await;
                    OpenedConnectionEvent {
                        result,
                        requested_shard: Some(shard),
                        keyspace_name: None,
                    }
                }
                .boxed()
            }
            _ => {
                let non_shard_aware_address = (self.address, self.regular_port).into();
                async move {
                    let result =
                        connection::open_connection(non_shard_aware_address, None, cfg).await;
                    OpenedConnectionEvent {
                        result,
                        requested_shard: None,
                        keyspace_name: None,
                    }
                }
                .boxed()
            }
        };
        self.ready_connections.push(fut);
    }
// Starts opening a new connection in the background. The result of connecting
// will be available on `ready_connections`. If the shard is specified and
// the shard aware port is available, it will attempt to connect directly
// to the shard using the port.
Starts opening a new connection in the background. The result of connecting
will be available on `ready_connections`. If the shard is specified and
the shard aware port is available, it will attempt to connect directly
to the shard using the port.
Starts opening a new connection in the background . The result of connecting will be available on ` ready_connections ` . If the shard is specified and the shard aware port is available it will attempt to connect directly to the shard using the port .
fn start_opening_connection(&self, shard: Option<Shard>) {
        let cfg = self.pool_config.connection_config.clone();
        let fut = match (self.sharder.clone(), self.shard_aware_port, shard) {
            (Some(sharder), Some(port), Some(shard)) => {
                let shard_aware_address = (self.address, port).into();
                async move {
                    let result = open_connection_to_shard_aware_port(
                        shard_aware_address,
                        shard,
                        sharder.clone(),
                        &cfg,
                    )
                    .await;
                    OpenedConnectionEvent {
                        result,
                        requested_shard: Some(shard),
                        keyspace_name: None,
                    }
                }
                .boxed()
            }
            _ => {
                let non_shard_aware_address = (self.address, self.regular_port).into();
                async move {
                    let result =
                        connection::open_connection(non_shard_aware_address, None, cfg).await;
                    OpenedConnectionEvent {
                        result,
                        requested_shard: None,
                        keyspace_name: None,
                    }
                }
                .boxed()
            }
        };
        self.ready_connections.push(fut);
    }
fn start_opening_connection ( & self , shard : Option < Shard > ) { let cfg = self . pool_config . connection_config . clone ( ) ; let fut = match ( self . sharder . clone ( ) , self . shard_aware_port , shard ) { ( Some ( sharder ) , Some ( port ) , Some ( shard ) ) => { let shard_aware_address = ( self . address , port ) . into ( ) ; async move { let result = open_connection_to_shard_aware_port ( shard_aware_address , shard , sharder . clone ( ) , & cfg , ) . await ; OpenedConnectionEvent { result , requested_shard : Some ( shard ) , keyspace_name : None , } } . boxed ( ) } _ => { let non_shard_aware_address = ( self . address , self . regular_port ) . into ( ) ; async move { let result = connection :: open_connection ( non_shard_aware_address , None , cfg ) . await ; OpenedConnectionEvent { result , requested_shard : None , keyspace_name : None , } } . boxed ( ) } } ; self . ready_connections . push ( fut ) ; }
Starts opening a new connection in the background.
Starts opening a new connection in the background .
&self
shard
Option<Shard>
&self
shard
Option<Shard>