1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//! Rust bindings for the lsquic-backed QUIC transport in
//! `packages/bun-usockets/src/quic.{c,h}`. One opaque per C handle; the
//! HTTP/3 server uses these via the C++ uWS layer (`uws.H3`), the HTTP/3
//! fetch client (`src/http/H3Client.zig`) uses them directly.
//!
//! Lifetimes: a `Context` outlives every `Socket` on it; a `Socket`
//! outlives every `Stream` on it. `Socket`/`Stream` pointers are valid
//! until their `on_close` callback returns, after which they are freed by
//! lsquic — never store them past that point.
#[path = "quic/Context.rs"]
pub mod context;
#[path = "quic/Header.rs"]
pub mod header;
#[path = "quic/PendingConnect.rs"]
pub mod pending_connect;
#[path = "quic/Socket.rs"]
pub mod socket;
#[path = "quic/Stream.rs"]
pub mod stream;
pub use self::context::Context;
pub use self::pending_connect::PendingConnect;
pub use self::socket::Socket;
pub use self::stream::Stream;
pub use self::header::Header;
pub use self::header::Qpack;
unsafe extern "C" {
// safe: no args; idempotent C-side initialization with no preconditions.
pub(crate) safe fn us_quic_global_init();
}
#[inline]
pub fn global_init() {
us_quic_global_init()
}
// ported from: src/uws_sys/quic.zig