Available on crate feature
extensions only.Expand description
NOMAD Protocol - Extensions
Implements protocol extensions for enhanced functionality beyond the core sync.
§Core Extensions
| ID | Module | Description |
|---|---|---|
| 0x0001 | compression | zstd payload compression |
| 0x0002 | priority | Update priority levels (critical → background) |
| 0x0003 | batching | Combine multiple updates into single frame |
| 0x0004 | rate_hints | Server hints for acceptable update frequency |
| 0x0005 | selective_sync | Subscribe to specific state regions |
| 0x0006 | checkpoint | Full state snapshots for recovery/initial sync |
| 0x0007 | metadata | Timestamps, user IDs, causality tracking |
§Extension Negotiation
Extensions are negotiated during handshake using TLV (Type-Length-Value) format.
See [negotiation] module for details.
§Reserved Ranges
0x0001-0x00FF: Core protocol extensions0x0100-0x0FFF: Application-specific extensions0xF000-0xFFFF: Experimental/private extensions
Modules§
- checkpoint_
config_ flags - Checkpoint negotiation flags
- checkpoint_
frame_ flags - Checkpoint frame flags
- ext_
type - Extension type identifiers
- metadata_
config_ flags - Metadata configuration flags
- metadata_
presence_ flags - Metadata presence flags (in wire format)
- rate_
hint_ flags - Rate hint flags
- selective_
sync_ flags - Selective sync flags
Structs§
- Batch
- A batch of updates ready for transmission
- Batching
Config - Batching extension configuration
- Checkpoint
- A complete checkpoint (header + payload)
- Checkpoint
Config - Checkpoint configuration
- Checkpoint
Header - A checkpoint frame header
- Compression
Config - Compression configuration
- Compression
Stats - Statistics for compression operations
- Compressor
- Compressor for sync payloads
- Extension
- Extension TLV (Type-Length-Value) format
- Extension
Set - Extension set for negotiation
- Metadata
- Metadata attached to a sync message
- Metadata
Config - Metadata configuration
- Priority
Config - Priority extension configuration
- Priority
Support Bitmap - Bitmap of supported priority levels
- Rate
Hint - A dynamic rate hint sent during the session
- Rate
Hints Config - Rate hints configuration for negotiation
- Selective
Sync Config - Selective sync configuration
- Subscription
State - Tracks active subscriptions for a client
- Vector
Clock - A vector clock for causality tracking
Enums§
- Checkpoint
Request - Request for a checkpoint
- Compress
Result - Result of compression attempt
- Compression
Error - Errors from compression operations.
- Negotiation
Error - Errors from extension negotiation.
- Priority
- Priority levels for state updates
- Rate
Hint Type - Type of rate hint
- Subscription
Change - A subscription change request
- Subscription
Op - Subscription operation type
Constants§
- CHECKPOINT_
HEADER_ SIZE - Header for a checkpoint frame
- DEFAULT_
COMPRESSION_ LEVEL - Default zstd compression level (1-22, higher = smaller but slower)
- DEFAULT_
MAX_ BATCH_ BYTES - Default maximum batch payload size (16 KB)
- DEFAULT_
MAX_ BATCH_ SIZE - Default maximum updates per batch
- DEFAULT_
MAX_ DELAY_ MS - Default maximum delay before flushing batch (50ms)
- EXTENSION_
HEADER_ SIZE - Header size for extension TLV
- MIN_
COMPRESS_ SIZE - Minimum payload size to attempt compression
Functions§
- negotiate
- Negotiate extensions between client and server offers