Skip to main content

Crate quiche_h3

Crate quiche_h3 

Source
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::Connection front-end (§6): the two bounded accept receivers, their per-direction accept-terminal cells and resume bits, and an embedded StreamOpener it delegates OpenStreams to.
H3QuicheAcceptor
A standalone HTTP/3-over-quiche acceptor: one per bound socket. Its accept yields the crate’s front-end Connection<Bytes>, which implements h3::quic::Connection<Bytes>. The h3_util::H3Acceptor conformance is provided by the h3-util quiche_h3 wrapper (Phase 9), keeping this crate free of a circular h3-util dependency (design §10).
H3QuicheClientConfig
Owned, cloneable client configuration. Holds cloneable QuicSettings and Hooks, optional owned TLS cert/key paths for mTLS, a verify_peer toggle applied per-connect, and an optional advisory SNI. A borrowing ConnectionParams<'_> is rebuilt from these owned fields inside each connect (§7.2).
H3QuicheConnector
A standalone HTTP/3-over-quiche connector. Clone + 'static (state lives behind an Arc). Its connect yields the crate’s front-end Connection<Bytes>, which implements h3::quic::Connection<Bytes>. The h3_util::H3Connector conformance is provided by the h3-util quiche_h3 wrapper (Phase 9), keeping this crate free of a circular h3-util dependency (design §10).
H3QuicheEndpoint
A cloneable handle to a server endpoint’s shutdown control surface — the quiche analog of quinn’s Endpoint::close / Endpoint::wait_idle.
H3QuicheServerConfig
Owned, cloneable server configuration. Owns everything tokio_quiche::listen borrows (TLS cert/key paths, QuicSettings, Hooks) so the acceptor is self-contained, plus the accept-queue depths and per-listener handshake cap (§7.1).
H3RecvStream
The h3::quic::RecvStream front-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. B appears only in the cmd_tx type — the received Buf is always Bytes.
H3SendStream
The h3::quic::SendStream front-end half (§6). Follows the h3 single-slot send contract: send_data stashes exactly one WriteBuf, poll_ready flushes it through the worker and reports the recorded completion once, and poll_finish/reset drive an idempotent finalization state machine.
H3Stream
A bidirectional stream: an H3SendStream + H3RecvStream that also implements BidiStream so h3 can split() it into its two halves (§6).
StreamOpener
The h3::quic::OpenStreams front-end (§6.1). Stream-ID allocation is worker-owned; poll_open_* only submit an OpenBidi/OpenUni request through the close-admission submit helper and await the worker’s handoff. A single-slot pending_* 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 Error shape (design §8.4). Defined here rather than imported so this crate carries no h3-util dependency (design §10).