Skip to main content

Module channel

Module channel 

Source
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§

ChannelRx
Universal channel receiver.
ChannelTx
Universal channel transmitter. Manages the link state, reconnections, etc. on top of a [net::Link].
CompletionReceipt
Future that resolves when a posted message is accepted or rejected.
CompletionSink
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-loop JoinHandle; the caller signals teardown with stop and 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.
SendError
An error that occurred during send. Returns the message that failed to send.
TcpModeIter
An iterator over the variants of TcpMode
TlsAddr
Address format for TLS channels.
TlsModeIter
An iterator over the variants of TlsMode

Enums§

BindSpec
Specifies how to bind a channel server.
ChannelAddr
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:
ChannelError
The type of error that can occur on channel operations.
ChannelTransport
Types of channel transports.
CloseReason
Reason a TxStatus transitioned to Closed. Callers should branch on the typed variants for cases they care about (e.g. cache-eviction logic in DialMailboxRouter keys on SequenceMismatch); everything else falls into Other and is for display/logging only.
SendErrorReason
Structured context for a send error.
ServerError
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§

Rx
The receive end of an M-typed channel.
Tx
The transmit end of an M-typed channel.

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 via channel::dial) deliver into the bundled ChannelRx<M>; duplex clients (dialed via channel::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 listener is Some, 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 TlsAcceptor for an HTTP server by probing for available TLS certificates.
try_tls_connector
Try to build a TlsConnector for an HTTP client that needs to connect to a TLS-enabled server.
try_tls_pem_bundle
Try to find a usable TLS PemBundle by probing the same sources as try_tls_acceptor / try_tls_connector.

Type Aliases§

Hostname
The type of (TCP) hostnames.
Port
The type of (TCP) ports.