userver: /home/antonyzhilin/arcadia/taxi/uservices/userver/libraries/proto-structs/include/userver/proto-structs/convert.hpp File Reference
Loading...
Searching...
No Matches
convert.hpp File Reference

Detailed Description

Functions for protobuf message to/from struct conversion.

Definition in file convert.hpp.

Go to the source code of this file.

#include <type_traits>
#include <utility>
#include <userver/proto-structs/exceptions.hpp>
#include <userver/proto-structs/impl/context.hpp>
#include <userver/proto-structs/type_mapping.hpp>
#include <userver/utils/assert.hpp>
+ This graph shows which files directly or indirectly include this file:

Namespaces

namespace  proto_structs
 Top namespace for the proto-structs library.
 

Functions

template<traits::ProtoMessage TMessage, traits::ProtoStruct TStruct>
void proto_structs::MessageToStruct (const TMessage &msg, TStruct &obj)
 Converts protobuf message msg to struct obj.
 
template<traits::ProtoStruct TStruct, traits::ProtoMessage TMessage>
TStruct proto_structs::MessageToStruct (const TMessage &msg)
 Converts protobuf message msg to specified structure type.
 
template<typename TStruct, traits::ProtoMessage TMessage>
requires traits::ProtoStruct<std::remove_cvref_t<TStruct>>
void proto_structs::StructToMessage (TStruct &&obj, TMessage &msg)
 Converts struct instance obj to protobuf message msg.
 
template<traits::ProtoMessage TMessage, typename TStruct>
requires traits::ProtoStruct<std::remove_cvref_t<TStruct>>
TMessage proto_structs::StructToMessage (TStruct &&obj)
 Converts struct instance obj to protobuf message msg of the specified type.
 
template<typename TStruct>
requires traits::CompatibleStruct<std::remove_cvref_t<TStruct>>
traits::CompatibleMessageType< std::remove_cvref_t< TStruct > > proto_structs::StructToMessage (TStruct &&obj)
 Converts struct instance obj to it's compatible protobuf message.