|
| enum class | WireType : uint8_t { Varint = 0
, LengthDelimited = 1
} |
| | Wire types for TLV encoding.
|
| |
|
|
static constexpr Crunch::Format | GetFormat () |
| |
| template<typename Message > |
| static consteval std::size_t | Size () noexcept |
| | Calculates the maximum possible serialized size of a message.
|
| |
| template<typename Message > |
| static constexpr std::size_t | Serialize (const Message &msg, std::span< std::byte > output) noexcept |
| | Serializes a message into the output buffer.
|
| |
| template<typename Message > |
| static constexpr auto | Deserialize (std::span< const std::byte > input, Message &msg) noexcept -> std::optional< Error > |
| | Deserializes a message from the input buffer.
|
| |
|
|
static constexpr std::size_t | WireTypeBits = 3 |
| | Number of bits used for the wire type in a tag.
|
| |
| static constexpr std::size_t | MaxTagBits |
| | The maximum number of bits required for a Tag (FieldID + WireType). Used for calculating the maximum size of a tag varint.
|
| |
◆ Deserialize()
template<typename Message >
| static constexpr auto Crunch::serdes::TlvLayout::Deserialize |
( |
std::span< const std::byte > |
input, |
|
|
Message & |
msg |
|
) |
| -> std::optional<Error> |
|
inlinestaticconstexprnoexcept |
Deserializes a message from the input buffer.
- Template Parameters
-
- Parameters
-
| input | The input buffer. |
| msg | The message object to populate. |
- Returns
- std::nullopt on success, or Error.
◆ Serialize()
template<typename Message >
| static constexpr std::size_t Crunch::serdes::TlvLayout::Serialize |
( |
const Message & |
msg, |
|
|
std::span< std::byte > |
output |
|
) |
| |
|
inlinestaticconstexprnoexcept |
Serializes a message into the output buffer.
- Template Parameters
-
- Parameters
-
| msg | The message to serialize. |
| output | The output buffer. |
- Returns
- The number of bytes written (offset).
◆ Size()
template<typename Message >
| static consteval std::size_t Crunch::serdes::TlvLayout::Size |
( |
| ) |
|
|
inlinestaticnoexcept |
Calculates the maximum possible serialized size of a message.
- Template Parameters
-
- Returns
- The size in bytes.
◆ MaxTagBits
| constexpr std::size_t Crunch::serdes::TlvLayout::MaxTagBits |
|
staticconstexpr |
Initial value:=
int32_t FieldId
Unique identifier for a field within a Crunch message.
Definition: crunch_types.hpp:11
static constexpr std::size_t WireTypeBits
Number of bits used for the wire type in a tag.
Definition: crunch_tlv_layout.hpp:66
The maximum number of bits required for a Tag (FieldID + WireType). Used for calculating the maximum size of a tag varint.
The documentation for this struct was generated from the following file: