Skip to main content

Crate nwd1_webtransport

Crate nwd1_webtransport 

Source
Expand description

Part of the nwd1 familyNetwork Wire Data v1 transport suite:

  • [netid64] → unique 64‑bit identifiers for network‑scoped entities
  • nwd1 → core binary frame definition
  • [nwd1-quic] → QUIC transport adapter
  • [nwd1-webtransport] → WebTransport (HTTP/3) adapter for browsers

Together they form a unified, transport‑safe data layer from raw QUIC to browser.

“nwd1” = Network Wire Data v1 — a minimal binary frame: MAGIC | LEN | ID | KIND | VER | PAYLOAD. This crate provides generic async helpers that work over any Tokio AsyncRead/AsyncWrite

Design goals:

  • Transport-agnostic helpers (server <-> browser via WebTransport planned)
  • Zero ambiguity in framing, big-endian network order
  • Early MAGIC check and length caps for safety

Constants§

DEFAULT_FRAME_LEN_SOFT
Reasonable default soft cap for browser-oriented traffic (256 KiB)
MAX_FRAME_LEN_HARD
Hard safety ceiling against pathological allocations (8 MiB)

Functions§

recv_frame
Receive a single nwd1 frame from any Tokio AsyncRead. Returns Ok(None) on graceful EOF before a full header is read.
send_frame
Send a single nwd1 frame over any Tokio AsyncWrite.