Trait samotop_delivery::smtp::net::tls::MayBeTls[][src]

pub trait MayBeTls: Send + Sync + Unpin + AsyncRead + AsyncWrite {
    pub fn encrypt(self: Pin<&mut Self>);
pub fn can_encrypt(&self) -> bool;
pub fn is_encrypted(&self) -> bool; }

A stream implementing this trait may be able to upgrade to TLS But maybe not...

Required methods

pub fn encrypt(self: Pin<&mut Self>)[src]

Initiates the TLS negotiations. The stream must then block all reads/writes until the underlying TLS handshake is done. If it is not possible to encrypt and subsequent reads/writes must fail.

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

Returns true only if calling encrypt would make sense:

  1. required encryption setup information is available.
  2. the stream is not encrypted yet.

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

Returns true if the stream is already encrypted.

Loading content...

Implementors

impl MayBeTls for TlsCapable[src]

impl<TLSIO, T> MayBeTls for T where
    T: DerefMut<Target = TLSIO> + Unpin + AsyncRead + AsyncWrite + Sync + Send,
    TLSIO: MayBeTls + Unpin + ?Sized
[src]

Loading content...