Struct tls_api::TlsStreamWithSocket[][src]

pub struct TlsStreamWithSocket<S: AsyncSocket>(_);

TLS stream object returned by connect_with_socket and accept_with_socket operations.

Since Rust has no HKT, it is not possible to declare something like

trait TlsConnector {
    type <S> TlsStream<S> : TlsStreamImpl;
}

So TlsStream is actually a box to concrete TLS implementation. So each operation perform a virtual call (which is not a big deal for sockets).

This type is parameterized by socket type, TlsStream is simpler version of this stream.

Implementations

impl<S: AsyncSocket> TlsStreamWithSocket<S>[src]

pub fn new<I: TlsStreamWithUpcastDyn<S>>(imp: I) -> TlsStreamWithSocket<S>[src]

Construct a stream from a stream implementation.

This function is intended to be used by API implementors, not by users.

pub fn without_type_parameter(self) -> TlsStream[src]

Convert to a functionally and performance identical TLS stream object but without socket type parameter.

Trait Implementations

impl<S: AsyncSocket> AsyncRead for TlsStreamWithSocket<S>[src]

impl<S: AsyncSocket> AsyncWrite for TlsStreamWithSocket<S>[src]

impl<S: AsyncSocket> Debug for TlsStreamWithSocket<S>[src]

impl<S: AsyncSocket> Deref for TlsStreamWithSocket<S>[src]

type Target = dyn TlsStreamWithUpcastDyn<S>

The resulting type after dereferencing.

impl<S: AsyncSocket> DerefMut for TlsStreamWithSocket<S>[src]

impl<S: AsyncSocket> TlsStreamDyn for TlsStreamWithSocket<S>[src]

impl<S: AsyncSocket> TlsStreamWithSocketDyn<S> for TlsStreamWithSocket<S>[src]

fn get_socket_mut(&mut self) -> &mut S[src]

Get a reference the underlying TLS-wrapped socket.

fn get_socket_ref(&self) -> &S[src]

Get a reference the underlying TLS-wrapped socket.

Auto Trait Implementations

Blanket Implementations

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

impl<R> AsyncReadExt for R where
    R: AsyncRead + ?Sized
[src]

impl<W> AsyncWriteExt for W where
    W: AsyncWrite + ?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<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.