Protocol Buffers - Google's data interchange format (grpc依赖)
https://developers.google.com/protocol-buffers/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.7 KiB
39 lines
1.7 KiB
#include "rust/cpp_kernel/map.h" |
|
|
|
#include <cstdint> |
|
#include <string> |
|
|
|
#include "google/protobuf/map.h" |
|
#include "rust/cpp_kernel/strings.h" |
|
|
|
extern "C" { |
|
|
|
void proto2_rust_thunk_UntypedMapIterator_increment( |
|
google::protobuf::internal::UntypedMapIterator* iter) { |
|
iter->PlusPlus(); |
|
} |
|
|
|
__PB_RUST_EXPOSE_SCALAR_MAP_METHODS_FOR_VALUE_TYPE(int32_t, i32, int32_t, value, |
|
cpp_value); |
|
__PB_RUST_EXPOSE_SCALAR_MAP_METHODS_FOR_VALUE_TYPE(uint32_t, u32, uint32_t, |
|
value, cpp_value); |
|
__PB_RUST_EXPOSE_SCALAR_MAP_METHODS_FOR_VALUE_TYPE(float, f32, float, value, |
|
cpp_value); |
|
__PB_RUST_EXPOSE_SCALAR_MAP_METHODS_FOR_VALUE_TYPE(double, f64, double, value, |
|
cpp_value); |
|
__PB_RUST_EXPOSE_SCALAR_MAP_METHODS_FOR_VALUE_TYPE(bool, bool, bool, value, |
|
cpp_value); |
|
__PB_RUST_EXPOSE_SCALAR_MAP_METHODS_FOR_VALUE_TYPE(uint64_t, u64, uint64_t, |
|
value, cpp_value); |
|
__PB_RUST_EXPOSE_SCALAR_MAP_METHODS_FOR_VALUE_TYPE(int64_t, i64, int64_t, value, |
|
cpp_value); |
|
__PB_RUST_EXPOSE_SCALAR_MAP_METHODS_FOR_VALUE_TYPE( |
|
std::string, ProtoBytes, google::protobuf::rust::PtrAndLen, |
|
std::string(value.ptr, value.len), |
|
google::protobuf::rust::PtrAndLen(cpp_value.data(), cpp_value.size())); |
|
__PB_RUST_EXPOSE_SCALAR_MAP_METHODS_FOR_VALUE_TYPE( |
|
std::string, ProtoString, google::protobuf::rust::PtrAndLen, |
|
std::string(value.ptr, value.len), |
|
google::protobuf::rust::PtrAndLen(cpp_value.data(), cpp_value.size())); |
|
|
|
} // extern "C"
|
|
|