nwd1-quic
QUIC transport for nwd1 binary frames.
nwd1-quic provides async helpers to send and receive nwd1 frames over QUIC streams, using the quinn library.
It integrates seamlessly with netid64 identifiers and uses Tokio runtime.
🧱 Frame Layout
Each frame follows the nwd1 binary format:
MAGIC (4B) | LEN (4B) | ID (8B) | KIND (1B) | VER (8B) | PAYLOAD (variable)
MAGIC: constantb"NWD1"headerLEN: total byte length following header (u32, BE)ID: 64-bit network ID (netid64)KIND: frame type discriminatorVER: protocol versionPAYLOAD: binary application data
⚙️ Example
use ;
use Frame;
use NetId64;
use Bytes;
use ;
async
🧩 Design
- Fully async,
tokio+quinn - Uses
read_exact_opt()helper for compact error handling - Checks frame
MAGICearly to avoid wasteful allocations - Enforces maximum frame length (
MAX_FRAME_LEN = 8 MiB) for safety
📦 License
Licensed under either of:
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
at your option.