Expand description
Duplex channel API: a single connection carries messages in both directions.
Structs§
- Duplex
Client - A handle to a duplex client session: wraps the send/recv halves
and the spawned task driving the connection. Owns a cancellation
token so callers can deterministically stop the recv/send loop
via
DuplexClient::join. - Duplex
Rx - Receiver half of a duplex channel.
- Duplex
Server - Public duplex server that yields
(DuplexRx<In>, DuplexTx<Out>)pairs. - Duplex
Tx - Sender half of a duplex channel.
Functions§
- dial
- Connect to a duplex server. Returns a
DuplexClientwrapping the send/recv halves and the spawned recv/send task; callers useDuplexClient::tx/DuplexClient::take_rxto extract the halves andDuplexClient::jointo deterministically shut the session down. - serve
- Start a duplex server on the given address.