Expand description
ZMTP 3.1 over QUIC transport implementation.
This module implements ZMTP (ZeroMQ Message Transport Protocol) version 3.1 running over QUIC streams. QUIC provides TLS 1.3 encryption at the transport layer, so the ZMTP handshake uses the NULL mechanism (CurveZMQ not needed).
§Protocol Mapping
TCP connection → QUIC connection (+ TLS 1.3)
TCP byte stream → Single QUIC bidirectional stream (ordered, reliable)
ZMTP greeting → Sent as first 64 bytes on the QUIC stream
ZMTP handshake → NULL mechanism (TLS handles encryption)
ZMTP message frames → Identical framing on the QUIC stream§ZMTP Frame Format
Flags (1 byte):
Bit 0 (LSB): MORE — 1 if more frames follow, 0 if last frame
Bit 1: LONG — 1 if size is 8-byte uint64, 0 if size is 1-byte uint8
Bit 2: COMMAND — 1 = command frame, 0 = message frame
Bits 3-7: Reserved (must be 0)
Size:
LONG=0: 1 byte (uint8, frames 0–255 bytes)
LONG=1: 8 bytes (uint64 big-endian, frames up to 2^64 bytes)
Body: exactly `size` bytesRe-exports§
pub use crate::zmtp_framing::ZmqSocketType;pub use crate::zmtp_framing::GREETING_SIZE;pub use crate::zmtp_framing::MECHANISM_NULL;pub use crate::zmtp_framing::ZMTP_VERSION_MAJOR;pub use crate::zmtp_framing::ZMTP_VERSION_MINOR;pub use crate::envelope::EnvelopeVerification;
Structs§
- Multipart
- ZMQ multipart message (owned).
- Quic
Pull - PULL socket: accepts connections from multiple PUSHers, fans in to single receiver.
- Quic
Push - PUSH socket: opens connection, sends frames on a persistent bidi stream.
- QuicRep
- Server-side REP socket over QUIC.
- QuicReq
- Client-side REQ socket over QUIC.
- Quic
Service Loop - Service loop for hosting RequestService over QUIC transport.
- QuicSub
- Client-side SUB socket over QUIC.
- QuicX
Pub - Server-side XPUB socket over QUIC.
- Zmtp
Command - A parsed ZMTP command (with
Bytesbody for async I/O efficiency). - Zmtp
Frame - A parsed ZMTP frame (with
Bytesdata for async I/O efficiency). - Zmtp
Stream - ZMTP 3.1 framing over a byte stream.
Constants§
- ALPN_
ZMTP3 - ALPN protocol identifier for ZMTP over QUIC.
Functions§
- cert_
hash - Compute SHA-256 hash of certificate for browser
serverCertificateHashes(base64). - client_
tls_ pinned - Create a TLS client config that pins a specific server certificate.
- client_
tls_ system_ roots - Create a TLS client config that trusts system root certificates.
- server_
tls_ self_ signed - Generate a self-signed TLS certificate for development/testing.