vexil-runtime
Rust runtime for code generated by the Vexil schema compiler. You don't use this crate directly -- it's a dependency of generated code. Add it alongside vexil-codegen-rust.
Contents
| Export | Purpose |
|---|---|
BitWriter / BitReader |
LSB-first bit-level I/O. A u3 field reads and writes exactly 3 bits. |
Pack / Unpack |
Traits implemented by generated structs and enums. |
leb128 |
Unsigned and signed LEB128 variable-length integer encoding. |
zigzag |
ZigZag encoding for signed integers (i32/i64 -> unsigned). |
DecodeError / EncodeError |
Structured error types for wire failures. |
SchemaHandshake |
BLAKE3 hash exchange for schema mismatch detection before data transfer. |
BitReader::read_remaining() |
Read all remaining bytes (for forward-compatible unknown field handling). |
Wire format
Fields are packed LSB-first, left-to-right within each byte. No padding between fields. The byte stream is only padded to byte alignment at the end of a message.
A u4 followed by a u4 occupies exactly 1 byte. A u5 followed by a u4 occupies 2 bytes (9 bits, padded to 16).
Safety limits
- Max recursion depth: 64 (encode and decode)
- Max byte array / string length: 16 MiB
- Max collection count: 1,048,576 elements
License
Licensed under either of MIT or Apache-2.0 at your option.