Add message IDs, transport interface, client package, extract protocol headers

This commit is contained in:
Ian Gulliver
2026-04-03 17:41:44 +09:00
parent 302f7fdb6a
commit 64953ef985
10 changed files with 251 additions and 152 deletions

View File

@@ -718,6 +718,13 @@ inline result<parser> unpack(const parser &p, std::string_view &out) {
return p.next();
}
inline result<parser> unpack(const parser &p, std::string &out) {
auto v = p.get_string();
if (!v) return std::unexpected(v.error());
out = std::string(v->data(), v->size());
return p.next();
}
inline result<parser> unpack(const parser &p, std::vector<uint8_t> &out) {
auto v = p.get_binary_view();
if (!v) return std::unexpected(v.error());