[][src]Enum new_tokio_smtp::io::Socket

pub enum Socket {
    Secure(TlsStream<TcpStream>),
    Insecure(TcpStream),
}

Abstraction over Tcp, TcpTls (and Mock)

Allows treating both TcpStream and TlsStream<TcpStream> the same.

Features

mock_support

if enabled this abstracts not only over TcpStream and TlsStream<TcpStream but also Box<MockStream+Send>

Variants

Insecure(TcpStream)

Implementations

impl Socket[src]

pub fn is_secure(&self) -> bool[src]

true if it's a TlsStream (or if mock says so)

Trait Implementations

impl AsyncRead for Socket[src]

impl AsyncWrite for Socket[src]

impl Debug for Socket[src]

impl From<Socket> for Connection[src]

create a new Connection from a Socket instance

The Socket instance should contain a socket which is still alive.

impl From<Socket> for Io[src]

impl Read for Socket[src]

impl Write for Socket[src]

Auto Trait Implementations

impl !RefUnwindSafe for Socket

impl Send for Socket

impl Sync for Socket

impl Unpin for Socket

impl !UnwindSafe for Socket

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<R> ReadBytesExt for R where
    R: Read + ?Sized

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<W> WriteBytesExt for W where
    W: Write + ?Sized