Skip to main content

Crate tpack

Crate tpack 

Source
Expand description

§tpack

The std facade for TPACK.

This crate re-exports the core API and derive macros, and it hosts convenience features that depend on the standard library.

§Features

  • derive default feature for native derive support
  • serde_support for schema-aware serde integration
  • std for registry and convenience APIs built on top of the core crate

§Native Path

For low-latency use cases, prefer the native traits and a schema registry that can resolve SchemaRef payloads without extra work.

When decoding FullSchemaWithId with a registry hit, the default path now reparses the embedded schema bytes and requires them to match the cached schema before reusing the cached AST. If a deployment intentionally trusts the registry entry and wants the older skip-only behavior, set DecodeOptions::validate_embedded_schema_on_cache_hit to false.

§Serde Path

The serde bridge is available when the serde_support feature is enabled. It is intended for compatibility and convenience, not the fastest decode path.

from_slice and from_value keep the default path small. When serde decoding needs a registry, custom limits, or custom DecodeOptions, use serde_support::Deserializer::new() and configure it with builder-style methods before calling slice or value.

Structs§

CalendarInterval
Decimal
DecodeOptions
Decoder behavior switches and resource limits.
Decoder
Duration
EncodeOptions
Encoder behavior switches and resource limits.
Encoder
Envelope
Error
ErrorPath
Field
Limits
Resource limits applied during schema validation and message encode/decode.
Message
Schema
SchemaId
StdSchemaRegistry
ValueMapEntry
Variant

Enums§

CanonicalMode
EnvelopeMode
ErrorKind
ErrorSource
PathSegment
TimestampPrecision
TpackValue
TypeDescriptor

Constants§

MAGIC
VERSION

Traits§

FromTpackValue
SchemaRegistry
TpackDeserialize
TpackSerialize

Functions§

decode_message
empty_registry
encode_message
encode_schema
encode_value

Type Aliases§

Result

Derive Macros§

TpackDeserialize
TpackSerialize