qmux 0.4.1

QMux protocol (draft-ietf-quic-qmux-02) over reliable transports
Documentation
//! 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.

// ALPN/subprotocol negotiation is only used by the TLS and WebSocket transports.
#[cfg(any(feature = "tls", feature = "ws"))]
mod alpn;
mod config;
mod credit;
mod error;
mod proto;
mod protocol;
mod sched;
mod session;
mod stream;

/// Transport abstraction and the byte-stream [`transport::Stream`] implementation.
pub mod transport;

/// Plain TCP transport.
#[cfg(feature = "tcp")]
pub mod tcp;

/// Unix domain socket transport.
#[cfg(all(unix, feature = "uds"))]
pub mod uds;

/// TLS over TCP transport.
#[cfg(feature = "tls")]
pub mod tls;

/// WebSocket transport.
#[cfg(feature = "ws")]
pub mod ws;

// Re-export the WebSocket dependencies so downstream integrations can use the
// exact versions compatible with QMux's public WebSocket types.
#[cfg(feature = "ws")]
pub use tokio_tungstenite;

#[cfg(feature = "ws")]
pub use tokio_tungstenite::tungstenite;

#[cfg(feature = "ws")]
pub use ws::{Client, KeepAlive, Server};

use proto::*;

pub use config::{Config, Protocol};
pub use error::Error;
pub use proto::Version;
pub use session::{RecvStream, SendStream, Session};
pub use stream::{StreamDir, StreamId};
pub use transport::Transport;
// The transport half-traits live at `transport::{Reader, Writer}` and the concrete
// byte-stream transport at `transport::Stream`, rather than the crate root — the
// bare `Reader`/`Writer`/`Stream` names would be too generic (and `Stream` would
// collide with the STREAM-frame `Stream` type) alongside the rest of the API.

/// All supported ALPN identifiers, in preference order.
///
/// Use this when configuring TLS to advertise QMux support.
/// For version-specific ALPNs, use [`Version::alpn()`].
pub const ALPNS: &[&str] = &["qmux-02", "qmux-01", "qmux-00", "webtransport"];