msgpack::map_view can be used to iterate, pair-wise, over a range of
msgpack::token. It will immediately return if the first token is not a
map, and will skip over nested map/arrays.
Note for the future: It will be handy to be able to get the subspan
corresponding to the nested map/array. Will think about how to solve
that later.
Begin incorporating map_view into the server.
Add formatters for std::byte, dynamic theme for bool, and spans thereof.
Maybe switch to range?
- Added token_reader::read_some(), which takes a view of a token buffer
reads/unpacks up to that many tokens from a buffer. If an error occurs,
or if there are fewer msgpack formats within the buffer, then the
returned span will be a subspan of the original buffer. If no tokens
were read before encountering an error, token_reader will return the
error instead.
- token::operator== overload for types that might be stored within the
token. Handy for cleaning up tests, even though both methods of
`token::get<T>() == value` and `token == value` are represented for
now.
- Added a simple tool to open a file containing msgpack content and read
tokens into a buffer. This is for testing speed, but needs to be made
into a proper benchmark once more work has been done. Pretty fast
right now, only taking 2us to parse ~200 tokens (that takes the
pythong msgpack implementation ~1s to handle).
This essentially completes the token_reader. In the future, we will
probably want something that lets us allocate maps/arrays more
seamlessly, but we can start working on client-server architecture with
this reader.