nxtquic-api 0.1.2

High-level async API for NxtQuic
Documentation

nxtquic-api

Crates.io Documentation License: MIT OR Apache-2.0 Rust: 1.85+

High-level async API for NxtQuic.

nxtquic-api is the ergonomic async/await layer of the NxtQuic workspace. It wraps the I/O-free nxtquic-proto state machine and the nxtquic-udp socket layer into a beautiful, Tokio-compatible API with familiar AsyncRead / AsyncWrite stream interfaces.

Features

  • Endpoint — bind a QUIC UDP endpoint as client or server
  • Connection — manage a single QUIC connection with full lifecycle control
  • SendStream / RecvStreamAsyncWrite / AsyncRead-compatible bidirectional and unidirectional streams
  • Unreliable datagrams — send/receive RFC 9221 datagrams through the same connection
  • Tokio runtime integration — optional tokio-runtime feature (enabled by default)
  • TLS via rustls — secure connections with zero-copy TLS session tickets

Feature flags

Flag Default Description
tokio-runtime ✅ yes Enable the Tokio-based async driver

Quick Start

[dependencies]
nxtquic-api = "0.1.2"
tokio = { version = "1", features = ["full"] }
use nxtquic_api::{Endpoint, ServerConfig};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let endpoint = Endpoint::server(server_config, "0.0.0.0:4433".parse()?).await?;
    while let Some(incoming) = endpoint.accept().await {
        let conn = incoming.accept().await?;
        tokio::spawn(handle_connection(conn));
    }
    Ok(())
}

For the full workspace including HTTP/3, WebTransport, and simulation, use the top-level nxtquic crate.

Part of the NxtQuic workspace

Crate Purpose
nxtquic Top-level re-export, async API
nxtquic-proto Core state machine
nxtquic-crypto Pluggable crypto backends
nxtquic-udp Platform-optimized UDP I/O
nxtquic-api Tokio async/await API (this crate)
nxtquic-h3 HTTP/3 + QPACK
nxtquic-sim Deterministic network simulator
nxtquic-qlog qlog structured logging

License

Licensed under either of MIT or Apache-2.0 at your option.