#ifndef GOOGLE_PROTOBUF_COMPILER_RUST_MAPPING_FILE_H__ #define GOOGLE_PROTOBUF_COMPILER_RUST_MAPPING_FILE_H__ #include #include "absl/container/flat_hash_map.h" #include "absl/status/statusor.h" #include "google/protobuf/compiler/rust/context.h" namespace google { namespace protobuf { namespace compiler { namespace rust { // Returns a map from import path of a .proto file to the name of the crate // (proto_library) covering that file. // // This function parses a .rust_crate_mapping file generated by Bazel. The file // contains: // // \n // \n // \n // ... // \n // // repeated for each proto_library transitively reachable from the current // proto_library. // // Note that the logic of translating the proto_library label to a crate name // is handled by the build system completely, protoc is only given the end // results. See `_render_text_crate_mapping` in // //third_party/protobuf/rust:aspects.bzl for how Bazel does this. absl::StatusOr> GetImportPathToCrateNameMap(const Options* opts); } // namespace rust } // namespace compiler } // namespace protobuf } // namespace google #endif // GOOGLE_PROTOBUF_COMPILER_RUST_MAPPING_FILE_H__