pub(crate) async fn receive_handshake(&mut self, url: &Url) -> crate::Result<Handshake> {
        let handshake = Handshake::decode(self.receive().await?.packet())?;

        let mut client_capabilities = Capabilities::PROTOCOL_41
            | Capabilities::IGNORE_SPACE
            | Capabilities::FOUND_ROWS
            | Capabilities::TRANSACTIONS
            | Capabilities::SECURE_CONNECTION
            | Capabilities::PLUGIN_AUTH_LENENC_DATA
            | Capabilities::PLUGIN_AUTH;

        if url.database().is_some() {
            client_capabilities |= Capabilities::CONNECT_WITH_DB;
        }

        if cfg!(feature = "tls") {
            client_capabilities |= Capabilities::SSL;
        }

        self.capabilities =
            (client_capabilities & handshake.server_capabilities) | Capabilities::PROTOCOL_41;

        Ok(handshake)
    }
/// Receive a [Handshake] packet. When connecting to the database server, this is immediately
/// received from the database server.
Receive a [Handshake] packet. When connecting to the database server, this is immediately
received from the database server.
Receive a [ Handshake ] packet . When connecting to the database server this is immediately received from the database server .
pub(crate) async fn receive_handshake(&mut self, url: &Url) -> crate::Result<Handshake> {
        let handshake = Handshake::decode(self.receive().await?.packet())?;
        let mut client_capabilities = Capabilities::PROTOCOL_41
            | Capabilities::IGNORE_SPACE
            | Capabilities::FOUND_ROWS
            | Capabilities::TRANSACTIONS
            | Capabilities::SECURE_CONNECTION
            | Capabilities::PLUGIN_AUTH_LENENC_DATA
            | Capabilities::PLUGIN_AUTH;
        if url.database().is_some() {
            client_capabilities |= Capabilities::CONNECT_WITH_DB;
        }
        if cfg!(feature = "tls") {
            client_capabilities |= Capabilities::SSL;
        }
        self.capabilities =
            (client_capabilities & handshake.server_capabilities) | Capabilities::PROTOCOL_41;
        Ok(handshake)
    }
pub ( crate ) async fn receive_handshake ( & mut self , url : & Url ) -> crate :: Result < Handshake > { let handshake = Handshake :: decode ( self . receive ( ) . await ? . packet ( ) ) ? ; let mut client_capabilities = Capabilities :: PROTOCOL_41 | Capabilities :: IGNORE_SPACE | Capabilities :: FOUND_ROWS | Capabilities :: TRANSACTIONS | Capabilities :: SECURE_CONNECTION | Capabilities :: PLUGIN_AUTH_LENENC_DATA | Capabilities :: PLUGIN_AUTH ; if url . database ( ) . is_some ( ) { client_capabilities |= Capabilities :: CONNECT_WITH_DB ; } if cfg ! ( feature " " ) { client_capabilities |= Capabilities :: SSL ; } self . capabilities = ( client_capabilities & handshake . server_capabilities ) | Capabilities :: PROTOCOL_41 ; Ok ( handshake ) }
Receive a [Handshake] packet.
Receive a [ Handshake ] packet .
&mut self
url
&Url
&mut self
url
&Url