pub enum Transport {
Tcp(TcpVariant),
Unix(UnixStream),
}Expand description
Transport layer abstraction
Variants§
Implementations§
Source§impl Transport
impl Transport
Sourcepub async fn connect_tcp(host: &str, port: u16) -> Result<Self>
pub async fn connect_tcp(host: &str, port: u16) -> Result<Self>
Connect via plain TCP
Sourcepub async fn connect_tcp_tls(
host: &str,
port: u16,
tls_config: &TlsConfig,
) -> Result<Self>
pub async fn connect_tcp_tls( host: &str, port: u16, tls_config: &TlsConfig, ) -> Result<Self>
Connect via TLS-encrypted TCP using PostgreSQL SSL negotiation protocol.
PostgreSQL requires a specific SSL upgrade sequence:
- Send SSLRequest message (8 bytes)
- Server responds with ‘S’ (accept) or ‘N’ (reject)
- If accepted, perform TLS handshake
Sourcepub async fn connect_unix(path: &Path) -> Result<Self>
pub async fn connect_unix(path: &Path) -> Result<Self>
Connect via Unix socket
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Transport
impl !RefUnwindSafe for Transport
impl Send for Transport
impl Sync for Transport
impl Unpin for Transport
impl !UnwindSafe for Transport
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more