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/stream"
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 |
stream.dodo |
option |
core/option |
stream.dodo |
tls |
std/tls |
stream.dodo |
State
Struct · Source
Movable TLS state; the same ciphertext buffers must accompany each resume. No socket or buffer borrow survives suspension.
pub struct State<E> {
// Private implementation fields omitted.
}
State.new
Function · Source
pub fn new(engine: E) -> State<E> from(engine)
Stream
Struct · Source
Generic composition: E is a TLS engine, T is an io polling transport. Caller-provided bounded staging; exclusive transport and buffer borrows retained through destruction. Each pump makes at most one transport read and write.
pub struct Stream<E, T> {
// Private implementation fields omitted.
}
Stream.new
Function · Source
pub fn new(engine: E, transport: &mut T, incoming: &mut[u8], outgoing: &mut[u8]) -> Stream<E, T>!tls.Error from(transport, incoming, outgoing)
Stream.resume
Function · Source
pub fn resume(state: State<E>, transport: &mut T, incoming: &mut[u8], outgoing: &mut[u8]) -> Stream<E, T>!tls.Error from(state, transport, incoming, outgoing)
Stream.suspend
Function · Source
pub fn suspend(self) -> State<E>
Stream.pump
Function · Source
pub fn pump(&mut self) -> bool!tls.Error
Stream.handshake
Function · Source
pub fn handshake(&mut self) -> tls.State!tls.Error
Stream.handshake_until
Function · Source
Caller supplies monotonic time/deadline and cancellation observation. Deadline is inclusive. Failure permanently invalidates this stream.
pub fn handshake_until(&mut self, now: u64, deadline: u64, cancelled: bool) -> tls.State!tls.Error
Stream.take_error
Function · Source
Preserve the typed TLS cause when adapting to the std/io contract.
pub fn take_error(&mut self) -> Option<tls.Error>
Stream.poll_read
Function · Source
pub fn poll_read(&mut self, destination: &mut[u8]) -> io.Poll!io.Error
Stream.poll_write
Function · Source
pub fn poll_write(&mut self, source: &[u8]) -> io.Poll!io.Error
Stream.read
Function · Source
pub fn read(&mut self, destination: &mut[u8]) -> usize!io.Error
Stream.write
Function · Source
pub fn write(&mut self, source: &[u8]) -> usize!io.Error
Stream.flush
Function · Source
Ready only once private plaintext and ciphertext staging have drained.
pub fn flush(&mut self) -> tls.State!tls.Error
Stream.shutdown
Function · Source
pub fn shutdown(&mut self) -> tls.State!tls.Error
Stream.transport
Function · Source
Checked read-only transport access enables hosted readiness without extending the portable polling transport contract.
pub fn transport(&self) -> &T from(self)
Stream.output_pending
Function · Source
pub fn output_pending(&self) -> bool
Stream.abort
Function · Source
pub fn abort(&mut self)