Expand description
quiche-h3 — an h3::quic bridge that runs hyperium h3 over
Cloudflare quiche, driven asynchronously by tokio_quiche.
See docs/design/quiche-h3-bridge.md for the full design.
The public surface exposes a standalone H3QuicheAcceptor /
H3QuicheConnector whose accept() / connect() yield the crate’s
front-end Connection<Bytes>, which implements
h3::quic::Connection<Bytes>. The h3_util::H3Acceptor /
h3_util::H3Connector trait conformance lives in h3-util’s quiche_h3
wrapper (Phase 9): because h3-util depends on quiche-h3, this crate must
not depend on h3-util (that would be circular, design §10). The
strongest checks available here are the compile-time assertions below that
Connection<Bytes> implements h3::quic::Connection<Bytes> and that
accept() / connect() return that type.
Re-exports§
pub use tokio_quiche;pub use tokio_quiche::quiche;
Structs§
- Connection
- The
h3::quic::Connectionfront-end (§6): the two bounded accept receivers, their per-direction accept-terminal cells and resume bits, and an embeddedStreamOpenerit delegatesOpenStreamsto. - H3Quiche
Acceptor - A standalone HTTP/3-over-quiche acceptor: one per bound socket. Its
acceptyields the crate’s front-endConnection<Bytes>, which implementsh3::quic::Connection<Bytes>. Theh3_util::H3Acceptorconformance is provided by the h3-utilquiche_h3wrapper (Phase 9), keeping this crate free of a circular h3-util dependency (design §10). - H3Quiche
Client Config - Owned, cloneable client configuration. Holds cloneable
QuicSettingsandHooks, optional owned TLS cert/key paths for mTLS, averify_peertoggle applied per-connect, and an optional advisory SNI. A borrowingConnectionParams<'_>is rebuilt from these owned fields inside eachconnect(§7.2). - H3Quiche
Connector - A standalone HTTP/3-over-quiche connector.
Clone + 'static(state lives behind anArc). Itsconnectyields the crate’s front-endConnection<Bytes>, which implementsh3::quic::Connection<Bytes>. Theh3_util::H3Connectorconformance is provided by the h3-utilquiche_h3wrapper (Phase 9), keeping this crate free of a circular h3-util dependency (design §10). - H3Quiche
Endpoint - A cloneable handle to a server endpoint’s shutdown control surface — the
quiche analog of quinn’s
Endpoint::close/Endpoint::wait_idle. - H3Quiche
Server Config - Owned, cloneable server configuration. Owns everything
tokio_quiche::listenborrows (TLS cert/key paths,QuicSettings,Hooks) so the acceptor is self-contained, plus the accept-queue depths and per-listener handshake cap (§7.1). - H3Recv
Stream - The
h3::quic::RecvStreamfront-end half (§6). Drains the bounded byte channel first, then reads the out-of-band terminal; a producer-coalesced resume bit is flipped false→true when capacity is freed.Bappears only in thecmd_txtype — the receivedBufis alwaysBytes. - H3Send
Stream - The
h3::quic::SendStreamfront-end half (§6). Follows the h3 single-slot send contract:send_datastashes exactly oneWriteBuf,poll_readyflushes it through the worker and reports the recorded completion once, andpoll_finish/resetdrive an idempotent finalization state machine. - H3Stream
- A bidirectional stream: an
H3SendStream+H3RecvStreamthat also implementsBidiStreamso h3 cansplit()it into its two halves (§6). - Stream
Opener - The
h3::quic::OpenStreamsfront-end (§6.1). Stream-ID allocation is worker-owned;poll_open_*only submit anOpenBidi/OpenUnirequest through the close-admission submit helper and await the worker’s handoff. A single-slotpending_*receiver makes repeated polls idempotent.
Constants§
- DEFAULT_
MAX_ IN_ FLIGHT_ HANDSHAKES - Default per-listener cap on concurrently-progressing handshakes (§7.1). The incoming branch of the accept loop is not polled once this many handshakes are in flight, bounding the bridge-owned worker/future set under a flood.
Type Aliases§
- Error
- The crate error type: a boxed, thread-safe error matching h3-util’s boxed
Errorshape (design §8.4). Defined here rather than imported so this crate carries noh3-utildependency (design §10).