Skip to main content

Crate turnloop_io

Crate turnloop_io 

Source
Expand description

Shared transport glue. See the crate README for the adapter ownership contract.

Re-exports§

pub use turnloop;

Modules§

dns
Native SRV/TXT discovery on turnloop’s bounded blocking pool. WASI 0.2 exposes A/AAAA via ip-name-lookup; it does not expose SRV/TXT records.
pool
Shared executor scheduling for sans-I/O connection pools. Policies stay in protocol crates; this module owns sockets, waiter wakeups and absolute timers.

Structs§

AsyncIo
TCP, UDP, local-pipe or stdio adapter with stable owned staging buffers.
CloseOnDrop
Close an owned stream if an exchange fails or its future is cancelled. Commit only after all accepted output is flushed and parser progress is saved.
Driver
A shared sans-I/O driver. Protocol crates only implement SansIo; transport flushing, partial input, cancellation and read scheduling live here once.
Exchange
Dropping an unfinished operation aborts both its protocol and transport.
ExecutorHandle
Cloneable local access to executor resource wrappers and task spawning.
Instant
A measurement of a monotonically nondecreasing clock. Opaque and useful only with Duration.
LingerClose
Future for linger_close. It borrows the stream and caller-retained scratch, allocates nothing, and waits only on the stream’s own read and one executor timer, so an idle peer costs no turns before the deadline.
Lingered
Outcome of a lingering close, including proof of the discarded input.
Listener
Owned listener. Drop cancels accepts and closes the backend handle.

Enums§

LingerEnd
How the discard phase of a lingering close ended.

Traits§

AsyncRead
Read bytes asynchronously.
AsyncWrite
Write bytes asynchronously.
Backend
Safety
HalfClose
A stream whose write direction can end while its read direction stays open.
Output
Core-owned wire output. Acknowledged only after a successful complete flush.
SansIo
Protocol-core contract used by database and mail adapters. Events can borrow the core; the callback must finish consuming them before the next drive step.
Stream
A TCP, pipe, TLS or host stream with cancellation-safe futures-io operations.

Functions§

close
Gracefully close after flushing accepted writes.
deadline
One deadline shared across every phase of an exchange; uses the executor timer.
drain
Drive one output phase without allocating another wire buffer.
error
Preserve portable error kinds even where no OS error number exists.
flush
Wait for delivery of accepted writes.
linger_close
Lingering close, as nginx lingering_close: flush and half-close, read and discard peer input until its EOF or deadline, then close.
read
Read into caller storage; an empty read means transport EOF.
resolve
Resolve a service endpoint using the loop’s DNS capability. Literal IPs need no resolver and work on every raw-socket backend.
shutdown
Half-close: flush accepted writes and end the write direction, keeping the transport open for reads. close keeps its full-close semantics.
write_all
Write all bytes and confirm transport delivery before releasing their owner.