)]}'
{
  "commit": "001be3c65545365574e13d0099b9eb241b338f2f",
  "tree": "025e039c838a301e8c363cde66e2246087cfeac0",
  "parents": [
    "1fa484c4ed0877ea9ade22c3147175a476711589"
  ],
  "author": {
    "name": "Jakob Buchgraber",
    "email": "buchgr@google.com",
    "time": "Thu Nov 16 01:36:28 2023 -0800"
  },
  "committer": {
    "name": "Copybara-Service",
    "email": "copybara-worker@google.com",
    "time": "Thu Nov 16 01:38:42 2023 -0800"
  },
  "message": "Implement Maps for scalar types for the C++ kernel\n\nThis CL implements Maps for scalar types for the C++ runtime. It\u0027s orthogonal to cl/580453646. This CL is constrained by having to force template instantiation of proto2::Map\u003cK, V\u003e. Put differently, a Rust protobuf::Map\u003cK, V\u003e implementation needs to call \u0027extern \"C\"\u0027 functions with both key and value type in the function name (e.g. __pb_rust_Map_i32_f64_get()). We use macros to generate a Map implementation for every (K,V)-pair. An alternative would have been to use vtables.\n\nLuckily a key in a protobuf map can only be integer types, bool and string. So the number of key types is bounded by the specification, while the number of value types is not i.e. any protobuf message can be a value in a map. Given these constraints we introduce one \u0027MapKeyOps\u0027 trait per key type e.g. MapKeyBOOLOps or MapKeyI32Ops. These traits need to be implemented for every value type e.g. \u0027impl MapKeyBOOLOps for i32\u0027 will implement \u0027Map::\u003cbool, i32\u003e\u0027. In particular the MapKeyOps traits can also be implemented for generated messages without violating the orphan rule.\n\nThis CL also contains significant changes to the UPB runtime so that both upb.rs and cpp.rs export a similar interface to simplify the implementation in  map.rs and the generated code.\n\nThis CL does not yet implement the Proxied trait.\n\nPiperOrigin-RevId: 582951914\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "2bd06aed0fea1ef9c3c955e494c9651cc88ed5a3",
      "old_mode": 33188,
      "old_path": "rust/BUILD",
      "new_id": "bc6a5cc9f47209530efd49abfeb0a0ba28a1cdda",
      "new_mode": 33188,
      "new_path": "rust/BUILD"
    },
    {
      "type": "modify",
      "old_id": "4346d4173f4c1fa223c9d6241513dd5f81e37f5c",
      "old_mode": 33188,
      "old_path": "rust/cpp.rs",
      "new_id": "11fd63462c29ce3b18a92d01dffa67916949161f",
      "new_mode": 33188,
      "new_path": "rust/cpp.rs"
    },
    {
      "type": "modify",
      "old_id": "13816110647558838d2c273a238450490d5eceab",
      "old_mode": 33188,
      "old_path": "rust/cpp_kernel/cpp_api.cc",
      "new_id": "97f2c3cdd0870fd62a3e257e8c1f96ea56c4ee45",
      "new_mode": 33188,
      "new_path": "rust/cpp_kernel/cpp_api.cc"
    },
    {
      "type": "modify",
      "old_id": "450b854f319174e53fc1a75a28c930d371d589a8",
      "old_mode": 33188,
      "old_path": "rust/map.rs",
      "new_id": "ab54698ee3b02900e5413793c0bbf3c225256ef0",
      "new_mode": 33188,
      "new_path": "rust/map.rs"
    },
    {
      "type": "modify",
      "old_id": "5aa054c0eb802ce37f216c6c46c2a9f9da67eb8d",
      "old_mode": 33188,
      "old_path": "rust/shared.rs",
      "new_id": "26f0629da1cada8223ae5dcb8be412e58fece605",
      "new_mode": 33188,
      "new_path": "rust/shared.rs"
    },
    {
      "type": "modify",
      "old_id": "291e0df23443b6fa1c3487c7b881a4d99013380f",
      "old_mode": 33188,
      "old_path": "rust/test/BUILD",
      "new_id": "03b16fb16e5ab84c2675bdddef612e59eb33f81c",
      "new_mode": 33188,
      "new_path": "rust/test/BUILD"
    },
    {
      "type": "modify",
      "old_id": "06f56338bd3cd50aaa640fca87931f3be64f2694",
      "old_mode": 33188,
      "old_path": "rust/test/shared/BUILD",
      "new_id": "04988de083acc38c1c28ec24710774e027a28c10",
      "new_mode": 33188,
      "new_path": "rust/test/shared/BUILD"
    },
    {
      "type": "modify",
      "old_id": "136f4edbbc47127b1f9d43499186ceb77c3a1c9a",
      "old_mode": 33188,
      "old_path": "rust/upb.rs",
      "new_id": "8f713dad696d06fe79cde7adf514ba9d2e5fb4f5",
      "new_mode": 33188,
      "new_path": "rust/upb.rs"
    },
    {
      "type": "modify",
      "old_id": "dcefbe8ae4669f72c734542666b48e7c4c0b77ab",
      "old_mode": 33188,
      "old_path": "src/google/protobuf/compiler/rust/accessors/accessor_generator.h",
      "new_id": "442de3c7cca5e220a1df2212a6adbd443ba94544",
      "new_mode": 33188,
      "new_path": "src/google/protobuf/compiler/rust/accessors/accessor_generator.h"
    },
    {
      "type": "modify",
      "old_id": "f7eda845c4f360ffe92b97d49fccdb0cd7f569a3",
      "old_mode": 33188,
      "old_path": "src/google/protobuf/compiler/rust/accessors/map.cc",
      "new_id": "1df6b23c42ac3247a4344027ea15bc239cfeb3cb",
      "new_mode": 33188,
      "new_path": "src/google/protobuf/compiler/rust/accessors/map.cc"
    }
  ]
}
