Closed justxuewei closed 1 year ago
Base: 25.71% // Head: 25.64% // Decreases project coverage by -0.08%
:warning:
Coverage data is based on head (
ce4775e
) compared to base (3522dac
). Patch has no changes to coverable lines.:exclamation: Current head ce4775e differs from pull request most recent head bfa8710. Consider uploading reports for the commit bfa8710 to get more accurate results
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
Hold this and going to reopen it when we need replace rust-protobuf in the future
This pull request introduces a new feature, prost, for the ttrpc-rust. The Prost is a modern Protobuf compiler that leverages the power of procedural macro of Rust. Currently, the prost version supports sync, async, and streaming. Here is part of the directory structure:
The ttrpc-rust is compatible with the older version, while there are certain differences:
ttrpc = { version = "1.0", features = ["prost"] }
.CPU
is generated by the Rust-protobuf, andCpu
is generated by the Prost."example2" gives some examples on how to use it. The functionalities are completely the same as "example".
Fixes: #170
codegen: Introduce a new codegen using prost
This pull request refactors the ttrpc-codegen and the compiler, and merges the two crates into a single crate, named "codegen". The codegen uses prost crate, a protobuf compiler for Rust.
Signed-off-by: Xuewei Niu niuxuewei.nxw@antgroup.com
ttrpc-rust: Support the new version of codegen
The ttrpc provides a "prost" feature to support the new version of codegen. An "example2" has been added to demonstrate how to use the codegen.
Signed-off-by: Xuewei Niu niuxuewei.nxw@antgroup.com
ci: Add codegen-related ci testing
Install protoc when executing
make deps
of the ttrpc. Add codegen's check and build, and example2' build to the ci testing.Signed-off-by: Xuewei Niu niuxuewei.nxw@antgroup.com
codegen: Fix issues reported by cargo clippy
Fix all issues reported by cargo clippy to make ci testing pass.
Signed-off-by: Xuewei Niu niuxuewei.nxw@antgroup.com