Expand description
The core Message trait and DecodeOptions builder.
Every generated message type implements Message, which provides
encode/decode/merge methods and a two-pass serialization model
(compute_size populates a SizeCache, write_to
consumes it) that avoids the exponential-time problem affecting naïve
length-delimited encoders.
Structs§
- Decode
Context - Per-decode limits threaded through every merge call.
- Decode
Options - Options for configuring message decoding behavior.
Constants§
- DEFAULT_
ELEMENT_ MEMORY_ LIMIT - Default element-memory budget: 32 MiB per top-level decode.
- DEFAULT_
UNKNOWN_ FIELD_ LIMIT - Default limit on unknown fields decoded per top-level decode: 1,000,000.
- MAX_
MESSAGE_ BYTES - Maximum encoded size of a protobuf message: 2 GiB − 1 (
0x7FFF_FFFF). - RECURSION_
LIMIT - Default recursion depth limit for decoding nested messages.
Traits§
- Message
- The core trait implemented by all protobuf message types.
- Message
Name - Compile-time access to a generated message’s protobuf identifiers.
Functions§
- checked_
encode_ size - Validate a computed encode size against
MAX_MESSAGE_BYTES. - saturate_
size - Saturate a
u64size accumulator tou32.