跳到主要内容

Module unbuffered

Module unbuffered 

Source
展开描述

非缓冲连接 API

This 是 alternative 到 the crate::ConnectionCommon API that does not internally 缓冲区 TLS nor 明文 data. Instead those buffers are managed by the API user so they have control over when 并 how 到 allocate, resize 并 dispose of them.

This API is lower level than the ConnectionCommon API 并 is built around 一个 state machine interface where the API user must handle each state 到 advance 并 complete the handshake process.

Like the ConnectionCommon API, no IO happens internally so all IO must be handled by the API user. Unlike the ConnectionCommon API, this API does not make use of the std::io::Readstd::io::Write traits so it’s usable in no-std context.

此 entry points into this API are crate::client::UnbufferedClientConnection::new, crate::server::UnbufferedServerConnection::newunbuffered::UnbufferedConnectionCommon::process_tls_records。 此 state machine API is documented in unbuffered::ConnectionState

§示例

unbuffered-clientunbuffered-server are examples that fully exercise the API in std, non-async context.

结构体§

AppDataRecord
A decrypted application-data record
EncodeTlsData
A handshake record must be encoded
InsufficientSizeError
Provided buffer was too small
ReadEarlyData
Early application-data is available.
ReadTraffic
Application data is available
TransmitTlsData
Previously encoded TLS data must be transmitted
UnbufferedConnectionCommon
Interface shared by unbuffered client and server connections.
UnbufferedStatus
The current status of the UnbufferedConnection*
WriteTraffic
Allows encrypting app-data

枚举§

ConnectionState
The state of the UnbufferedConnectionCommon object
EncodeError
Errors that may arise when encoding a handshake record
EncryptError
Errors that may arise when encrypting application data