Expand description
One-way, multi-process, typed communication channels. These are used to send messages between mailboxes residing in different processes.
Modules§
- duplex
- Duplex channel API: a single connection carries messages in both directions.
- unordered
- Channels that may deliver messages out of send order.
Structs§
- Channel
Rx - Universal channel receiver.
- Channel
Tx - Universal channel transmitter. Manages the link state, reconnections,
etc. on top of a [
net::Link]. - Completion
Receipt - Future that resolves when a posted message is accepted or rejected.
- Completion
Sink - Sink for the terminal outcome of a posted message.
- MuxServer
- A muxed server bundling a simplex receiver, a duplex accept server, and the shared shutdown signal that ties them together.
- MuxShutdown
- Awaitable shutdown handle for a
MuxServer. Wraps the muxed listener’s accept-loopJoinHandle; the caller signals teardown withstopand then.awaits the handle to confirm the listener task has fully exited. Drop cancels the shared signal as a backstop, so a forgotten handle does not leak the listener. - Send
Error - An error that occurred during send. Returns the message that failed to send.
- TcpMode
Iter - An iterator over the variants of TcpMode
- TlsAddr
- Address format for TLS channels.
- TlsMode
Iter - An iterator over the variants of TlsMode
Enums§
- Bind
Spec - Specifies how to bind a channel server.
- Channel
Addr - The type of a channel address, used to multiplex different underlying channel implementations. ChannelAddrs also have a concrete syntax: the address type (e.g., “tcp” or “local”), followed by “:”, and an address parseable to that type. For example:
- Channel
Error - The type of error that can occur on channel operations.
- Channel
Transport - Types of channel transports.
- Close
Reason - Reason a
TxStatustransitioned toClosed. Callers should branch on the typed variants for cases they care about (e.g. cache-eviction logic inDialMailboxRouterkeys onSequenceMismatch); everything else falls intoOtherand is for display/logging only. - Send
Error Reason - Structured context for a send error.
- Server
Error - Error returned during server operations.
- TcpMode
- The hostname to use for TLS connections.
- TlsMode
- The hostname to use for TLS connections.
- TxStatus
- The possible states of a
Tx.
Traits§
Functions§
- dial
- Dial the provided address, returning the corresponding Tx, or error if the channel cannot be established. The underlying connection is dropped whenever the returned Tx is dropped.
- reserve_
local_ addr - Reserve a local channel address that can be served later.
- serve
- Serve on the provided channel address. The server is turned down when the returned Rx is dropped.
- serve_
local - Serve on the local address. The server is turned down when the returned Rx is dropped.
- serve_
mux - Serve a muxed listener on
addr. Simplex clients (dialed viachannel::dial) deliver into the bundledChannelRx<M>; duplex clients (dialed viachannel::duplex::dial) populate the bundled [DuplexServer<In, Out>]. Only net transports are supported; the caller picks transports that implement both protocol styles. - serve_
with_ listener - Serve on the provided channel address, optionally using a pre-opened TCP listener.
When
listenerisSome, the provided listener is used instead of binding a new socket. The server is turned down when the returned Rx is dropped. - try_
tls_ acceptor - Try to build a
TlsAcceptorfor an HTTP server by probing for available TLS certificates. - try_
tls_ connector - Try to build a
TlsConnectorfor an HTTP client that needs to connect to a TLS-enabled server. - try_
tls_ pem_ bundle - Try to find a usable TLS
PemBundleby probing the same sources astry_tls_acceptor/try_tls_connector.