Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 10:12:00

0001 // Protocol Buffers - Google's data interchange format
0002 // Copyright 2023 Google LLC.  All rights reserved.
0003 //
0004 // Use of this source code is governed by a BSD-style
0005 // license that can be found in the LICENSE file or at
0006 // https://developers.google.com/open-source/licenses/bsd
0007 
0008 #ifndef GOOGLE_PROTOBUF_COMPILER_RUST_GENERATOR_H__
0009 #define GOOGLE_PROTOBUF_COMPILER_RUST_GENERATOR_H__
0010 
0011 #include <cstdint>
0012 #include <string>
0013 
0014 #include "google/protobuf/compiler/code_generator.h"
0015 
0016 // Must be included last.
0017 #include "google/protobuf/port_def.inc"
0018 
0019 namespace google {
0020 namespace protobuf {
0021 namespace compiler {
0022 namespace rust {
0023 
0024 class PROTOC_EXPORT RustGenerator final
0025     : public google::protobuf::compiler::CodeGenerator {
0026  public:
0027   RustGenerator() = default;
0028   RustGenerator(const RustGenerator&) = delete;
0029   RustGenerator& operator=(const RustGenerator&) = delete;
0030   ~RustGenerator() override = default;
0031 
0032   bool Generate(const FileDescriptor* file, const std::string& parameter,
0033                 GeneratorContext* generator_context,
0034                 std::string* error) const override;
0035 
0036   uint64_t GetSupportedFeatures() const override {
0037     return FEATURE_PROTO3_OPTIONAL | FEATURE_SUPPORTS_EDITIONS;
0038   }
0039   Edition GetMinimumEdition() const override { return Edition::EDITION_PROTO2; }
0040   Edition GetMaximumEdition() const override { return Edition::EDITION_2023; }
0041 };
0042 
0043 }  // namespace rust
0044 }  // namespace compiler
0045 }  // namespace protobuf
0046 }  // namespace google
0047 
0048 #include "google/protobuf/port_undef.inc"
0049 #endif  // GOOGLE_PROTOBUF_COMPILER_RUST_GENERATOR_H__