MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / ToProtobufAny

Function ToProtobufAny

common/internal/value_conversion.cc:194–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

192}
193
194absl::StatusOr<google::protobuf::Any> ToProtobufAny(
195 const StructValue& struct_value,
196 const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool,
197 google::protobuf::MessageFactory* absl_nonnull message_factory,
198 google::protobuf::Arena* absl_nonnull arena) {
199 google::protobuf::io::CordOutputStream serialized;
200 CEL_RETURN_IF_ERROR(
201 struct_value.SerializeTo(descriptor_pool, message_factory, &serialized));
202 google::protobuf::Any result;
203 result.set_type_url(MakeTypeUrl(struct_value.GetTypeName()));
204 result.set_value(std::string(std::move(serialized).Consume()));
205
206 return result;
207}
208
209} // namespace
210

Callers 1

ToExprValueFunction · 0.85

Calls 5

MakeTypeUrlFunction · 0.85
SerializeToMethod · 0.45
GetTypeNameMethod · 0.45
set_valueMethod · 0.45
ConsumeMethod · 0.45

Tested by

no test coverage detected