From 42c3073089c1d3e170cb0de9f5ed5a327ed4856d Mon Sep 17 00:00:00 2001 From: Ryan Leckey Date: Thu, 21 Nov 2019 21:40:31 +0000 Subject: [PATCH] connection.bak -> connection --- src/connection.rs | 18 +++++++++--------- src/error.rs | 4 ++-- src/mariadb/protocol/capabilities.rs | 2 +- src/mariadb/protocol/connect/initial.rs | 2 +- src/mariadb/protocol/connect/response.rs | 2 +- src/mariadb/protocol/text/com_process_kill.rs | 2 +- src/mariadb/protocol/text/com_reset_conn.rs | 2 +- src/postgres/protocol/cancel_request.rs | 4 ++-- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/connection.rs b/src/connection.rs index 9f73117d..ea7275c3 100644 --- a/src/connection.rs +++ b/src/connection.rs @@ -21,7 +21,7 @@ use std::{ time::Instant, }; -/// A connection.bak to the database. +/// A connection to the database. /// /// This trait is not intended to be used directly. Instead [sqlx::Connection] or [sqlx::Pool] should be used instead, which provide /// concurrent access and typed retrieval of results. @@ -30,20 +30,20 @@ pub trait RawConnection: Send { // The database backend this type connects to. type Backend: Backend; - /// Establish a new connection.bak to the database server. + /// Establish a new connection to the database server. async fn establish(url: &str) -> crate::Result where Self: Sized; - /// Release resources for this database connection.bak immediately. + /// Release resources for this database connection immediately. /// /// This method is not required to be called. A database server will eventually notice /// and clean up not fully closed connections. /// - /// It is safe to close an already closed connection.bak. + /// It is safe to close an already closed connection. async fn close(mut self) -> crate::Result<()>; - /// Verifies a connection.bak to the database is still alive. + /// Verifies a connection to the database is still alive. async fn ping(&mut self) -> crate::Result<()> { let _ = self .execute( @@ -115,7 +115,7 @@ where Ok(Self::new(live, None)) } - /// Verifies a connection.bak to the database is still alive. + /// Verifies a connection to the database is still alive. pub async fn ping(&self) -> crate::Result<()> { let mut live = self.0.acquire().await; live.raw.ping().await?; @@ -216,8 +216,8 @@ where { async fn acquire(&self) -> Live { if let Some(live) = self.live.swap(None) { - // Fast path, this connection.bak is not currently in use. - // We can directly return the inner connection.bak. + // Fast path, this connection is not currently in use. + // We can directly return the inner connection. return live; } @@ -230,7 +230,7 @@ where // which would drop this future receiver .await - .expect("waiter dropped without dropping connection.bak") + .expect("waiter dropped without dropping connection") } fn release(&self, mut live: Live) { diff --git a/src/error.rs b/src/error.rs index bfdb99c5..78d3cace 100644 --- a/src/error.rs +++ b/src/error.rs @@ -16,11 +16,11 @@ pub enum Error { /// /// - [io::ErrorKind::ConnectionRefused] - Database backend is most likely behind a firewall. /// - /// - [io::ErrorKind::ConnectionReset] - Database backend dropped the client connection.bak (perhaps from an administrator action). + /// - [io::ErrorKind::ConnectionReset] - Database backend dropped the client connection (perhaps from an administrator action). /// /// - [io::ErrorKind::InvalidData] - Unexpected or invalid data was encountered. This would indicate that we received data that we were not /// expecting or it was in a format we did not understand. This generally means either there is a programming error in a SQLx driver or - /// something with the connection.bak or the database backend itself is corrupted. Additional details are provided along with the + /// something with the connection or the database backend itself is corrupted. Additional details are provided along with the /// error. /// Io(io::Error), diff --git a/src/mariadb/protocol/capabilities.rs b/src/mariadb/protocol/capabilities.rs index 5dd886a5..e40da3de 100644 --- a/src/mariadb/protocol/capabilities.rs +++ b/src/mariadb/protocol/capabilities.rs @@ -41,7 +41,7 @@ bitflags::bitflags! { // Client supports plugin authentication const PLUGIN_AUTH = 1 << 19; - // Client send connection.bak attributes + // Client send connection attributes const CONNECT_ATTRS = 1 << 20; // Enable authentication response packet to be larger than 255 bytes diff --git a/src/mariadb/protocol/connect/initial.rs b/src/mariadb/protocol/connect/initial.rs index b93426d3..0c2d780d 100644 --- a/src/mariadb/protocol/connect/initial.rs +++ b/src/mariadb/protocol/connect/initial.rs @@ -119,7 +119,7 @@ mod test { 10u8, //string server version (MariaDB server version is by default prefixed by "5.5.5-") b"5.5.5-10.4.6-MariaDB-1:10.4.6+maria~bionic\0", - //int<4> connection.bak id + //int<4> connection id 13u8, 0u8, 0u8, 0u8, //string<8> scramble 1st part (authentication seed) b"?~~|vZAu", diff --git a/src/mariadb/protocol/connect/response.rs b/src/mariadb/protocol/connect/response.rs index 83c55a99..360c242e 100644 --- a/src/mariadb/protocol/connect/response.rs +++ b/src/mariadb/protocol/connect/response.rs @@ -74,7 +74,7 @@ impl<'a> Encode for HandshakeResponsePacket<'a> { // if (capabilities & CLIENT_CONNECT_ATTRS) if capabilities.contains(Capabilities::CONNECT_ATTRS) { - // size of connection.bak attributes : int + // size of connection attributes : int buf.put_uint_lenenc::(self.connection_attrs.len() as u64); for (key, value) in self.connection_attrs { diff --git a/src/mariadb/protocol/text/com_process_kill.rs b/src/mariadb/protocol/text/com_process_kill.rs index 9238bbc2..5a10f757 100644 --- a/src/mariadb/protocol/text/com_process_kill.rs +++ b/src/mariadb/protocol/text/com_process_kill.rs @@ -5,7 +5,7 @@ use crate::{ }; use byteorder::LittleEndian; -/// Forces the server to terminate a specified connection.bak. +/// Forces the server to terminate a specified connection. pub struct ComProcessKill { pub process_id: u32, } diff --git a/src/mariadb/protocol/text/com_reset_conn.rs b/src/mariadb/protocol/text/com_reset_conn.rs index e65cd702..0a064e7d 100644 --- a/src/mariadb/protocol/text/com_reset_conn.rs +++ b/src/mariadb/protocol/text/com_reset_conn.rs @@ -4,7 +4,7 @@ use crate::{ mariadb::protocol::{Capabilities, Encode}, }; -/// Resets a connection.bak without re-authentication. +/// Resets a connection without re-authentication. #[derive(Debug)] pub struct ComResetConnection; diff --git a/src/postgres/protocol/cancel_request.rs b/src/postgres/protocol/cancel_request.rs index 871b36bf..6bcaf02d 100644 --- a/src/postgres/protocol/cancel_request.rs +++ b/src/postgres/protocol/cancel_request.rs @@ -2,8 +2,8 @@ use super::Encode; use crate::io::BufMut; use byteorder::NetworkEndian; -/// Sent instead of [`StartupMessage`] with a new connection.bak to cancel a running query on an existing -/// connection.bak. +/// Sent instead of [`StartupMessage`] with a new connection to cancel a running query on an existing +/// connection. /// /// https://www.postgresql.org/docs/devel/protocol-flow.html#id-1.10.5.7.9 pub struct CancelRequest {