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
Sourcepub async fn connect_unix(path: &Path) -> Result<Self>
pub async fn connect_unix(path: &Path) -> Result<Self>
Connect via Unix socket
Sourcepub async fn upgrade_to_tls(
self,
tls_config: &TlsConfig,
hostname: &str,
) -> Result<Self>
pub async fn upgrade_to_tls( self, tls_config: &TlsConfig, hostname: &str, ) -> Result<Self>
Upgrade a plain TCP transport to TLS after SSLRequest negotiation.
Consumes self and returns a new Transport with a TLS-encrypted stream.
Returns an error if the transport is not a plain TCP connection.
Sourcepub fn channel_binding_data(&self) -> Option<Vec<u8>>
pub fn channel_binding_data(&self) -> Option<Vec<u8>>
Extract channel binding data from the transport (if TLS is active).
Returns None for plain TCP or Unix socket connections.
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 UnsafeUnpin 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