[]Struct yukikaze::connector::rustls::ServerSession

pub struct ServerSession { /* fields omitted */ }

This represents a single TLS server session.

Send TLS-protected data to the peer using the io::Write trait implementation. Read data from the peer using the io::Read trait implementation.

Methods

impl ServerSession

Important traits for ServerSession
pub fn new(config: &Arc<ServerConfig>) -> ServerSession

Make a new ServerSession. config controls how we behave in the TLS protocol.

pub fn get_sni_hostname(&self) -> Option<&str>

Retrieves the SNI hostname, if any, used to select the certificate and private key.

This returns None until some time after the client's SNI extension value is processed during the handshake. It will never be None when the connection is ready to send or process application data, unless the client does not support SNI.

This is useful for application protocols that need to enforce that the SNI hostname matches an application layer protocol hostname. For example, HTTP/1.1 servers commonly expect the Host: header field of every request on a connection to match the hostname in the SNI extension when the client provides the SNI extension.

The SNI hostname is also used to match sessions during session resumption.

Trait Implementations

impl Read for ServerSession

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

Obtain plaintext data received from the peer over this TLS connection.

impl Session for ServerSession

fn write_tls(&mut self, wr: &mut dyn Write) -> Result<usize, Error>

Writes TLS messages to wr.

impl Write for ServerSession

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

Send the plaintext buf to the peer, encrypting and authenticating it. Once this function succeeds you should call write_tls which will output the corresponding TLS records.

This function buffers plaintext sent before the TLS handshake completes, and sends it as soon as it can. This buffer is of unlimited size so writing much data before it can be sent will cause excess memory usage.

impl Debug for ServerSession

Auto Trait Implementations

impl Sync for ServerSession

impl Send for ServerSession

impl Unpin for ServerSession

impl !UnwindSafe for ServerSession

impl !RefUnwindSafe for ServerSession

Blanket Implementations

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

impl<T> From<T> for 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.

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

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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

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