pub enum Connection {
Plain(TcpStream),
Tls(Box<TlsStream<TcpStream>>),
}Expand description
Either a plain or a TLS-wrapped connection.
An enum rather than a boxed trait object: there are exactly two cases, and this keeps the read path free of dynamic dispatch.
Variants§
Implementations§
Auto Trait Implementations§
impl !Freeze for Connection
impl !RefUnwindSafe for Connection
impl !UnwindSafe for Connection
impl Send for Connection
impl Sync for Connection
impl Unpin for Connection
impl UnsafeUnpin for Connection
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