pub const MAX_MESSAGE_BYTES: u32 = 0x7FFF_FFFF;Expand description
Maximum encoded size of a protobuf message: 2 GiB − 1 (0x7FFF_FFFF).
The protobuf specification limits any message — top-level or nested — to 2 GiB. buffa enforces this symmetrically:
- Decode rejects length-delimited payloads declared larger than this
with
DecodeError::MessageTooLarge, matching protobuf C++ and Java. - Encode refuses to serialize a message whose encoded size would
exceed it: the panicking entry points (
Message::encodeand friends) panic, thetry_*twins (Message::try_encodeand friends) returnEncodeError::MessageTooLarge. Without this check a writer could produce bytes that no conforming decoder — including buffa’s own — will read back.