async fn connect(conf: &ConnectionConf) -> Result<(Context, Option<ClusterInfo>)> {
    eprintln!("info: Connecting to {:?}... ", conf.addresses);
    let session = context::connect(conf).await?;
    let session = Context::new(session);
    let cluster_info = session.cluster_info().await?;
    eprintln!(
        "info: Connected to {} running Cassandra version {}",
        cluster_info
            .as_ref()
            .map(|c| c.name.as_str())
            .unwrap_or("unknown"),
        cluster_info
            .as_ref()
            .map(|c| c.cassandra_version.as_str())
            .unwrap_or("unknown")
    );
    Ok((session, cluster_info))
}
/// Connects to the server and returns the session
Connects to the server and returns the session
Connects to the server and returns the session
async fn connect(conf: &ConnectionConf) -> Result<(Context, Option<ClusterInfo>)> {
    eprintln!("info: Connecting to {:?}... ", conf.addresses);
    let session = context::connect(conf).await?;
    let session = Context::new(session);
    let cluster_info = session.cluster_info().await?;
    eprintln!(
        "info: Connected to {} running Cassandra version {}",
        cluster_info
            .as_ref()
            .map(|c| c.name.as_str())
            .unwrap_or("unknown"),
        cluster_info
            .as_ref()
            .map(|c| c.cassandra_version.as_str())
            .unwrap_or("unknown")
    );
    Ok((session, cluster_info))
}
async fn connect ( conf : & ConnectionConf ) -> Result < ( Context , Option < ClusterInfo > ) > { eprintln ! ( " " conf addresses ) ; let session = context :: connect ( conf ) . await ? ; let session = Context :: new ( session ) ; let cluster_info = session . cluster_info ( ) . await ? ; eprintln ! ( " " cluster_info as_ref ( ) map ( c c name as_str ( ) ) unwrap_or ( " " ) cluster_info as_ref ( ) map ( c c cassandra_version as_str ( ) ) unwrap_or ( " " ) ) ; Ok ( ( session , cluster_info ) ) }
Connects to the server and returns the session
Connects to the server and returns the session
conf
&ConnectionConf
conf
&ConnectionConf