Struct rustls::ClientSession [] [src]

pub struct ClientSession { /* fields omitted */ }

This represents a single TLS client session.

Methods

impl ClientSession
[src]

Make a new ClientSession. config controls how we behave in the TLS protocol, hostname is the hostname of who we want to talk to.

Trait Implementations

impl Session for ClientSession
[src]

Read TLS content from rd. This method does internal buffering, so rd can supply TLS messages in arbitrary- sized chunks (like a socket or pipe might). Read more

Writes TLS messages to wr.

Processes any new packets read by a previous call to read_tls. Errors from this function relate to TLS protocol errors, and are fatal to the session. Future calls after an error will do no new work and will return the same error. Read more

Returns true if the caller should call read_tls as soon as possible. Read more

Returns true if the caller should call write_tls as soon as possible. Read more

Returns true if the session is currently perform the TLS handshake. During this time plaintext written to the session is buffered in memory. Read more

Queues a close_notify fatal alert to be sent in the next write_tls call. This informs the peer that the connection is being closed. Read more

Retrieves the certificate chain used by the peer to authenticate. Read more

Retrieves the protocol agreed with the peer via ALPN. Read more

Retrieves the protocol version agreed with the peer. Read more

impl Read for ClientSession
[src]

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

Read all bytes until EOF in this source, placing them into buf. Read more

Read all bytes until EOF in this source, placing them into buf. Read more

Read the exact number of bytes required to fill buf. Read more

Creates a "by reference" adaptor for this instance of Read. Read more

Transforms this Read instance to an Iterator over its bytes. Read more

🔬 This is a nightly-only experimental API.   (io)

the semantics of a partial read/write of where errors happen is currently unclear and may change

Transforms this Read instance to an Iterator over chars. Read more

Creates an adaptor which will chain this stream with another. Read more

Creates an adaptor which will read at most limit bytes from it. Read more

impl Write for ClientSession
[src]

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.

Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more

Attempts to write an entire buffer into this write. Read more

Writes a formatted string into this writer, returning any error encountered. Read more

Creates a "by reference" adaptor for this instance of Write. Read more