userver: /data/code/userver/libraries/proto-structs/src/proto-structs/io/userver/proto_structs/any.cpp Source File
Loading...
Searching...
No Matches
any.cpp
1#include <userver/proto-structs/io/userver/proto_structs/any.hpp>
2
3#include <userver/proto-structs/any.hpp>
4
5USERVER_NAMESPACE_BEGIN
6
7namespace proto_structs::io {
8
9proto_structs::Any ReadProtoStruct(ReadContext&, To<proto_structs::Any>, const ::google::protobuf::Any& msg) {
10 return proto_structs::Any{msg};
11}
12
13void WriteProtoStruct(WriteContext&, const proto_structs::Any& obj, ::google::protobuf::Any& msg) {
14 msg = obj.GetProtobufAny();
15}
16
17void WriteProtoStruct(WriteContext&, proto_structs::Any&& obj, ::google::protobuf::Any& msg) {
18 msg = std::move(obj).GetProtobufAny();
19}
20
21} // namespace proto_structs::io
22
23USERVER_NAMESPACE_END