andrewhickman / prost-reflect

A protobuf library extending prost with reflection support and dynamic messages.
https://crates.io/crates/prost-reflect
Apache License 2.0
91 stars 21 forks source link

Add support for unknown fields #52

Closed andrewhickman closed 1 year ago

andrewhickman commented 1 year ago

This is a minimal API to start with, which only supports getting the number and wire type of unknown fields, and encoding them into another buffer. We are still free to change the internal representation.

Partially implements #15

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 89.71% and project coverage change: +0.28% :tada:

Comparison is base (de355a5) 75.89% compared to head (5b80742) 76.18%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #52 +/- ## ========================================== + Coverage 75.89% 76.18% +0.28% ========================================== Files 31 31 Lines 5302 5399 +97 ========================================== + Hits 4024 4113 +89 - Misses 1278 1286 +8 ``` | [Files Changed](https://app.codecov.io/gh/andrewhickman/prost-reflect/pull/52?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Andrew+Hickman) | Coverage Δ | | |---|---|---| | [prost-reflect/src/descriptor/global.rs](https://app.codecov.io/gh/andrewhickman/prost-reflect/pull/52?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Andrew+Hickman#diff-cHJvc3QtcmVmbGVjdC9zcmMvZGVzY3JpcHRvci9nbG9iYWwucnM=) | `70.00% <ø> (ø)` | | | [prost-reflect/src/dynamic/text\_format/format.rs](https://app.codecov.io/gh/andrewhickman/prost-reflect/pull/52?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Andrew+Hickman#diff-cHJvc3QtcmVmbGVjdC9zcmMvZHluYW1pYy90ZXh0X2Zvcm1hdC9mb3JtYXQucnM=) | `93.85% <83.33%> (+0.52%)` | :arrow_up: | | [prost-reflect/src/dynamic/fields.rs](https://app.codecov.io/gh/andrewhickman/prost-reflect/pull/52?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Andrew+Hickman#diff-cHJvc3QtcmVmbGVjdC9zcmMvZHluYW1pYy9maWVsZHMucnM=) | `86.80% <84.21%> (+0.74%)` | :arrow_up: | | [prost-reflect/src/dynamic/unknown.rs](https://app.codecov.io/gh/andrewhickman/prost-reflect/pull/52?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Andrew+Hickman#diff-cHJvc3QtcmVmbGVjdC9zcmMvZHluYW1pYy91bmtub3duLnJz) | `90.00% <94.20%> (ø)` | | | [prost-reflect/src/dynamic/message.rs](https://app.codecov.io/gh/andrewhickman/prost-reflect/pull/52?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Andrew+Hickman#diff-cHJvc3QtcmVmbGVjdC9zcmMvZHluYW1pYy9tZXNzYWdlLnJz) | `72.70% <100.00%> (-0.27%)` | :arrow_down: | | [prost-reflect/src/dynamic/mod.rs](https://app.codecov.io/gh/andrewhickman/prost-reflect/pull/52?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Andrew+Hickman#diff-cHJvc3QtcmVmbGVjdC9zcmMvZHluYW1pYy9tb2QucnM=) | `56.13% <100.00%> (+1.41%)` | :arrow_up: | ... and [2 files with indirect coverage changes](https://app.codecov.io/gh/andrewhickman/prost-reflect/pull/52/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Andrew+Hickman)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.