tpack-core 0.1.0

Core wire codec, schema AST, validation, and native traits for TPACK
Documentation
  • Coverage
  • 2.65%
    6 out of 226 items documented0 out of 0 items with examples
  • Size
  • Source code size: 95.5 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.4 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 11s Average build duration of successful builds.
  • all releases: 11s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • pluveto/tpack
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • pluveto

tpack-core

The core execution layer for TPACK.

This crate is designed for #![no_std] with alloc. It owns the wire codec, schema AST, validation logic, and the native traits used by the higher-level crates.

Execution Model

Decoder<'de> operates on a borrowed input buffer and advances a cursor through the message. The data path is intended to stay allocation-free for borrowed values.

When FullSchemaWithId hits a schema registry entry, the decoder reuses the cached schema AST. By default it still reparses the embedded schema bytes and requires them to match the cached schema before the cached AST is accepted. This keeps cache hits fast without silently trusting mismatched embedded schema payloads.

Value Model

Borrowed payloads stay borrowed:

  • strings are represented as &'de str
  • bytes are represented as &'de [u8]
  • structural values are decoded according to the active schema

Canonical Mode

When canonical checking is enabled, the decoder rejects:

  • overlong varints
  • unordered map keys
  • non-canonical floating-point NaN encodings
  • trailing bytes after a valid message

Limits

Limits apply to both schema validation and value processing. In particular, max_schema_len is enforced symmetrically on decode and encode paths so an encoder cannot emit a schema that the decoder would reject under the same limits.