working commit
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
|
||||
#include <expected>
|
||||
#include <string>
|
||||
#include <cstring>
|
||||
#include <iostream>
|
||||
#include <format>
|
||||
|
||||
#include <hello.pb.h>
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
control::Hello msg;
|
||||
msg.set_id(1);
|
||||
msg.set_name("bare");
|
||||
|
||||
auto meta = msg.mutable_meta();
|
||||
meta->set_rpcname("getHello");
|
||||
|
||||
std::string buffer;
|
||||
msg.SerializeToString(&buffer);
|
||||
|
||||
control::Header newmsg;
|
||||
newmsg.ParsePartialFromString(buffer);
|
||||
|
||||
auto newmeta = newmsg.meta();
|
||||
std::cout << std::format("{}\n", meta->rpcname());
|
||||
}
|
||||
Reference in New Issue
Block a user