Library guide · API index and notation
This page is generated from the bundled library in this checkout. Signatures and adjacent source comments are reproduced below; the linked guide explains usage, storage, failures, and platform support.
import "std/tls"
Names used in signatures
Unqualified names denote this package’s types (including other source files in the same package), language built-ins, or generic parameters such as T. Qualified names use the import aliases below. These aliases belong to the library source; import a dependency yourself to use its alias in your program.
| Alias | Package | Source file |
|---|---|---|
io |
std/io |
tls.dodo |
ErrorKind
Enum · Source
Portable TLS provider contracts. No cryptography, sockets, clock, entropy, allocation or execution provider is imported here.
pub enum ErrorKind {
InvalidInput, AllocationFailed, VerificationFailed, Protocol, Truncated,
Closed, Transport, Cancelled, TimedOut, Backend, LimitExceeded
}
Error
Struct · Source
pub struct Error {
pub kind: ErrorKind
// Numeric backend/verification code only; never credentials or plaintext.
pub code: i32
pub transferred: usize
}
Error.format
Function · Source
Only fixed kind names and numeric metadata; never input or native messages.
pub fn format<F>(&self, output: &mut F) -> void!io.Error
failure
Function · Source
pub fn failure(kind: ErrorKind, code: i32) -> Error
State
Enum · Source
pub enum State {
Ready, NeedInput, NeedOutput, Closed
}
Progress
Struct · Source
pub struct Progress {
pub state: State
pub transferred: usize
}
handshake
Function · Source
Provider: handshake()->State!Error, feed(ciphertext)->usize!Error, drain(ciphertext)->usize!Error, read_plain(destination)->Progress!Error, write_plain(source)->Progress!Error, shutdown()->State!Error, eof(). Every input is borrowed only for a call. Progress counts accepted prefixes; accepted writes belong to provider-owned staging until drained or aborted. NeedInput/NeedOutput transfer no ownership of caller storage to the provider.
pub fn handshake<P>(provider: &mut P) -> State!Error
io_error
Function · Source
pub fn io_error(reason: Error) -> io.Error
poll
Function · Source
pub fn poll(progress: Progress) -> io.Poll