#include </data/code/userver/libraries/proto-structs/include/userver/proto-structs/io/context.hpp>
Write operation context passed to user-defined WriteProtoStruct global functions.
Definition at line 103 of file context.hpp.
Public Types | |
| using | Error |
Public Member Functions | |
| template<typename T, typename U> | |
| void | WriteField (T &&struct_field, int field_number, U &message_field) |
| Converts proto struct field struct_field to the protobuf message field message_field with number field_number. | |
| template<typename TStruct, proto_structs::traits::ProtoMessage TMessage> requires proto_structs::traits::ProtoStruct<std::remove_cvref_t<TStruct>> | |
| void | WriteField (TStruct &&struct_field, int field_number, TMessage &message_field) |
| Converts proto struct field struct_field to the protobuf message field message_field with number field_number. | |
| bool | HasErrors () const noexcept |
| Returns true if context contains at least one error. | |
| void | AddError (int field_number, std::string_view reason) |
| Adds conversion error. | |
|
inherited |
Definition at line 50 of file context_base.hpp.
|
inherited |
Adds conversion error.
| Error | exception. Parameter field_number contains protobuf message field number for which conversion has failed. |
Definition at line 63 of file context_base.cpp.
|
inlinenoexceptinherited |
Returns true if context contains at least one error.
Definition at line 53 of file context_base.hpp.
|
inline |
Converts proto struct field struct_field to the protobuf message field message_field with number field_number.
| T | proto struct field type |
| U | protobuf message type |
Definition at line 119 of file context.hpp.
|
inline |
Converts proto struct field struct_field to the protobuf message field message_field with number field_number.
| T | proto struct field type |
| U | protobuf message type |
Definition at line 139 of file context.hpp.