pub async fn startup(
        self,
        session: Session,
    ) -> Result<(SessionClient, StartupResponse), CoordError> {
        // Cancellation works by creating a watch channel (which remembers only
        // the last value sent to it) and sharing it between the coordinator and
        // connection. The coordinator will send a cancelled message on it if a
        // cancellation request comes. The connection will reset that on every message
        // it receives and then check for it where we want to add the ability to cancel
        // an in-progress statement.
        let (cancel_tx, cancel_rx) = watch::channel(Cancelled::NotCancelled);
        let cancel_tx = Arc::new(cancel_tx);
        let mut client = SessionClient {
            inner: self,
            session: Some(session),
            cancel_tx: cancel_tx.clone(),
            cancel_rx,
        };
        let response = client
            .send(|tx, session| Command::Startup {
                session,
                cancel_tx,
                tx,
            })
            .await;
        match response {
            Ok(response) => Ok((client, response)),
            Err(e) => {
                // When startup fails, no need to call terminate. Remove the
                // session from the client to sidestep the panic in the `Drop`
                // implementation.
                client.session.take();
                Err(e)
            }
        }
    }
/// Upgrades this connection client to a session client.
///
/// A session is a connection that has successfully negotiated parameters,
/// like the user. Most coordinator operations are available only after
/// upgrading a connection to a session.
///
/// Returns a new client that is bound to the session and a response
/// containing various details about the startup.
Upgrades this connection client to a session client.
A session is a connection that has successfully negotiated parameters,
like the user. Most coordinator operations are available only after
upgrading a connection to a session.

Returns a new client that is bound to the session and a response
containing various details about the startup.
Upgrades this connection client to a session client . A session is a connection that has successfully negotiated parameters like the user . Most coordinator operations are available only after upgrading a connection to a session . Returns a new client that is bound to the session and a response containing various details about the startup .
pub async fn startup(
        self,
        session: Session,
    ) -> Result<(SessionClient, StartupResponse), CoordError> {
        // Cancellation works by creating a watch channel (which remembers only
        // the last value sent to it) and sharing it between the coordinator and
        // connection. The coordinator will send a cancelled message on it if a
        // cancellation request comes. The connection will reset that on every message
        // it receives and then check for it where we want to add the ability to cancel
        // an in-progress statement.
        let (cancel_tx, cancel_rx) = watch::channel(Cancelled::NotCancelled);
        let cancel_tx = Arc::new(cancel_tx);
        let mut client = SessionClient {
            inner: self,
            session: Some(session),
            cancel_tx: cancel_tx.clone(),
            cancel_rx,
        };
        let response = client
            .send(|tx, session| Command::Startup {
                session,
                cancel_tx,
                tx,
            })
            .await;
        match response {
            Ok(response) => Ok((client, response)),
            Err(e) => {
                // When startup fails, no need to call terminate. Remove the
                // session from the client to sidestep the panic in the `Drop`
                // implementation.
                client.session.take();
                Err(e)
            }
        }
    }
pub async fn startup ( self , session : Session , ) -> Result < ( SessionClient , StartupResponse ) , CoordError > { // Cancellation works by creating a watch channel (which remembers only // the last value sent to it) and sharing it between the coordinator and // connection. The coordinator will send a cancelled message on it if a // cancellation request comes. The connection will reset that on every message // it receives and then check for it where we want to add the ability to cancel // an in-progress statement. let ( cancel_tx , cancel_rx ) = watch :: channel ( Cancelled :: NotCancelled ) ; let cancel_tx = Arc :: new ( cancel_tx ) ; let mut client = SessionClient { inner : self , session : Some ( session ) , cancel_tx : cancel_tx . clone ( ) , cancel_rx , } ; let response = client . send ( | tx , session | Command :: Startup { session , cancel_tx , tx , } ) . await ; match response { Ok ( response ) => Ok ( ( client , response ) ) , Err ( e ) => { // When startup fails, no need to call terminate. Remove the // session from the client to sidestep the panic in the `Drop` // implementation. client . session . take ( ) ; Err ( e ) } } }
Upgrades this connection client to a session client.
Upgrades this connection client to a session client .
self
session
Session
self
session
Session