Skip to main content

TlsTransport

Struct TlsTransport 

Source
pub struct TlsTransport { /* private fields */ }
Expand description

TLS transport using rustls.

This wraps a rustls ClientConnection and provides a completion-based interface.

Implementations§

Source§

impl TlsTransport

Source

pub fn new(config: &TlsConfig, server_name: &str) -> Result<Self>

Create a new TLS transport for the given server name.

Source

pub fn alpn_protocol(&self) -> Option<&[u8]>

Get the negotiated ALPN protocol, if any.

Trait Implementations§

Source§

impl Transport for TlsTransport

Source§

fn state(&self) -> TransportState

Get the current transport state.
Source§

fn send(&mut self, data: &[u8]) -> Result<usize>

Queue data to be sent. Read more
Source§

fn recv(&mut self, buf: &mut [u8]) -> Result<usize>

Read available decrypted data. Read more
Source§

fn on_recv(&mut self, data: &[u8]) -> Result<()>

Process raw data received from the socket. Read more
Source§

fn pending_send(&self) -> &[u8]

Get data that needs to be sent on the socket. Read more
Source§

fn advance_send(&mut self, n: usize)

Mark bytes as sent on the socket.
Source§

fn shutdown(&mut self) -> Result<()>

Initiate shutdown.
Source§

fn is_ready(&self) -> bool

Check if the transport is ready for application data.
Source§

fn has_pending_send(&self) -> bool

Check if there’s pending data to send.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.