File indexing completed on 2025-01-31 10:12:00
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef GOOGLE_PROTOBUF_COMPILER_RUST_ENUM_H__
0009 #define GOOGLE_PROTOBUF_COMPILER_RUST_ENUM_H__
0010
0011 #include <cstdint>
0012 #include <string>
0013 #include <utility>
0014 #include <vector>
0015
0016 #include "absl/strings/string_view.h"
0017 #include "absl/types/span.h"
0018 #include "google/protobuf/compiler/rust/context.h"
0019 #include "google/protobuf/descriptor.h"
0020
0021 namespace google {
0022 namespace protobuf {
0023 namespace compiler {
0024 namespace rust {
0025
0026
0027 void GenerateEnumDefinition(Context& ctx, const EnumDescriptor& desc);
0028
0029
0030 void GenerateEnumThunksCc(Context& ctx, const EnumDescriptor& desc);
0031
0032
0033 struct RustEnumValue {
0034
0035 std::string name;
0036 int32_t number;
0037 std::vector<std::string> aliases;
0038 };
0039
0040
0041
0042
0043 std::vector<RustEnumValue> EnumValues(
0044 absl::string_view enum_name,
0045 absl::Span<const std::pair<absl::string_view, int32_t>> values);
0046
0047 }
0048 }
0049 }
0050 }
0051
0052 #endif