Skip to main content

Crate qmux

Crate qmux 

Source
Expand description

QMux protocol (draft-ietf-quic-qmux-02) over reliable transports.

Provides QUIC-style multiplexed streams over TCP, TLS, and WebSocket. Speaks draft-02 by default, negotiating down to draft-01 or draft-00, with backwards compatibility for the legacy webtransport wire format.

§Layout

The crate root holds the transport-independent session API: Session and its SendStream / RecvStream halves, plus the Config, Version, and Error types they share.

Everything tied to a specific transport lives in that transport’s module, so the generic names stay unambiguous when several are in scope at once:

ModuleEntry pointFeature
tcptcp::Configtcp
udsuds::Configuds (Unix only)
tlstls::Client, tls::Servertls
wsws::Client, ws::Server, ws::Upgradedws
transporttransport::Streamtcp or uds

For anything the built-in modules don’t cover, wrap an AsyncRead + AsyncWrite byte stream in transport::Stream, or implement transport::Transport yourself, and pass it to Session::connect / Session::accept.

Modules§

tcp
Plain TCP transport.
tls
TLS over TCP transport.
transport
Transport abstraction and the byte-stream transport::Stream implementation.
uds
Unix domain socket transport.
ws
WebSocket transport.

Structs§

Config
Configuration for a QMux session.
RecvStream
The receive half of a multiplexed stream.
SendStream
The send half of a multiplexed stream.
Session
A multiplexed session over a reliable transport.
StreamId
A QUIC-style stream identifier encoding direction and initiator.
TcpStats
Kernel TCP statistics for a socket, via TCP_INFO (Linux) or TCP_CONNECTION_INFO (macOS).

Enums§

Error
Errors that can occur during QMux session and stream operations.
Protocol
How the application-level protocol is determined for a session.
StreamDir
Stream direction.
Version
The wire format version used for frame encoding/decoding.

Constants§

ALPNS
All supported ALPN identifiers, in preference order.

Traits§

SocketStats
Live statistics for the connection underneath a QMux session.

Type Aliases§

SharedSocketStats
A shared handle to a transport’s statistics.