#include <witness_stack.hpp>
|
| static std::map< std::string, msgpack::object const * > | make_kvmap (msgpack::object const &o, std::string const &name) |
| |
| template<typename T > |
| static void | conv_fld_from_kvmap (std::map< std::string, msgpack::object const * > const &kvmap, std::string const &struct_name, std::string const &field_name, T &field, bool is_optional) |
| |
| template<typename T > |
| static void | conv_fld_from_array (msgpack::object_array const &array, std::string const &struct_name, std::string const &field_name, T &field, uint32_t index) |
| |
| template<typename T > |
| static void | convert_or_throw (msgpack::object const &val, std::string const &struct_name, std::string const &field_name, T &field) |
| |
| static bool | is_int_keyed_map (msgpack::object const &o) |
| |
| template<typename Dispatch > |
| static void | int_map_dispatch (msgpack::object const &o, std::string const &name, Dispatch &&dispatch) |
| |
| static void | check_size (uint32_t actual, std::string const &name, uint32_t active, uint32_t reserved) |
| |
Definition at line 14 of file witness_stack.hpp.
◆ check_size()
| static void Witnesses::Helpers::check_size |
( |
uint32_t |
actual, |
|
|
std::string const & |
name, |
|
|
uint32_t |
active, |
|
|
uint32_t |
reserved |
|
) |
| |
|
inlinestatic |
Cap a MAP or ARRAY entry count against active + reserved. Under-length wires are caught downstream (conv_fld_from_array errors out of bounds; conv_fld_from_kvmap errors on missing required keys), so we only need the upper bound here.
- Up to
reserved extra trailing entries are tolerated as retired fields (#[tagged(reserved(...))] on the Rust side).
- Anything beyond that is forward-compat drift that the producer only emits when newer fields were added. The Rust-side cue is
#[tagged(allow_unknown_tags)]; the message points at it so a reviewer can see the opt-in.
Definition at line 138 of file witness_stack.hpp.
◆ conv_fld_from_array()
template<typename T >
| static void Witnesses::Helpers::conv_fld_from_array |
( |
msgpack::object_array const & |
array, |
|
|
std::string const & |
struct_name, |
|
|
std::string const & |
field_name, |
|
|
T & |
field, |
|
|
uint32_t |
index |
|
) |
| |
|
inlinestatic |
◆ conv_fld_from_kvmap()
template<typename T >
| static void Witnesses::Helpers::conv_fld_from_kvmap |
( |
std::map< std::string, msgpack::object const * > const & |
kvmap, |
|
|
std::string const & |
struct_name, |
|
|
std::string const & |
field_name, |
|
|
T & |
field, |
|
|
bool |
is_optional |
|
) |
| |
|
inlinestatic |
◆ convert_or_throw()
template<typename T >
| static void Witnesses::Helpers::convert_or_throw |
( |
msgpack::object const & |
val, |
|
|
std::string const & |
struct_name, |
|
|
std::string const & |
field_name, |
|
|
T & |
field |
|
) |
| |
|
inlinestatic |
Convert val into field, or throw a focused error mentioning the struct + field name. Used by the int-keyed dispatch path where each switch case populates one field directly.
Definition at line 82 of file witness_stack.hpp.
◆ int_map_dispatch()
template<typename Dispatch >
| static void Witnesses::Helpers::int_map_dispatch |
( |
msgpack::object const & |
o, |
|
|
std::string const & |
name, |
|
|
Dispatch && |
dispatch |
|
) |
| |
|
inlinestatic |
Iterate an int-keyed MAP and invoke dispatch(tag, val) for each (u8, msgpack::object) entry. The per-tag switch inside the caller's lambda decides which field (or variant) to populate; unknown tags fall through to default and are silently skipped, matching the MsgpackTagged decoder's forward-compat policy (allow_unknown_tags / retired tags drained).
Definition at line 113 of file witness_stack.hpp.
◆ is_int_keyed_map()
| static bool Witnesses::Helpers::is_int_keyed_map |
( |
msgpack::object const & |
o | ) |
|
|
inlinestatic |
Whether o is a non-empty MAP whose first key is an integer. This is the signature of Format::MsgpackTagged: int keys for struct field tags and enum variant tags. Legacy Format::Msgpack keys are always strings, so a positive-integer first key is a reliable shape discriminator between the two.
Definition at line 100 of file witness_stack.hpp.
◆ make_kvmap()
| static std::map< std::string, msgpack::object const * > Witnesses::Helpers::make_kvmap |
( |
msgpack::object const & |
o, |
|
|
std::string const & |
name |
|
) |
| |
|
inlinestatic |
The documentation for this struct was generated from the following file: