Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfc3ecbe

Browse files
committed
use pure rust protobuf parser and code generator
1 parent23e6666 commitfc3ecbe

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

‎README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Add this to your Cargo.toml:
5959

6060
```toml
6161
[dependencies]
62-
rpcx ="0.1.3"
62+
rpcx ="0.2.0"
6363
```
6464

6565
##Example

‎examples/protobuf/mul_model_proto/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ protobuf = "2.8.0"
1212
rpcx = {version ="0.2.0",path ="../../../rpcx" }
1313

1414
[build-dependencies]
15-
protoc-rust ="2.8.0"
15+
protoc-rust ="2.8.0"
16+
protobuf-codegen-pure ="2.3"

‎examples/protobuf/mul_model_proto/build.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,18 @@ use protoc_rust::Customize;
33

44
fnmain(){
55

6-
protoc_rust::run(protoc_rust::Args{
6+
// protoc_rust::run(protoc_rust::Args {
7+
// out_dir: "src/",
8+
// input: &["protos/arith.proto"],
9+
// includes: &["protos"],
10+
// customize: Customize {
11+
// // serde_derive_cfg: None,
12+
// // serde_derive: Some(true),
13+
// ..Default::default()
14+
// },
15+
// }).expect("protoc");
16+
17+
protobuf_codegen_pure::run(protobuf_codegen_pure::Args{
718
out_dir:"src/",
819
input:&["protos/arith.proto"],
920
includes:&["protos"],

‎examples/protobuf/mul_model_proto/src/arith.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -386,9 +386,9 @@ impl ::protobuf::reflect::ProtobufValue for ProtoReply {
386386
}
387387

388388
static file_descriptor_proto_data:&'static[u8] =b"\
389-
\n\x0barith.proto\x12\x06client\"'\n\tProtoArgs\x12\x0c\n\x01A\x18\x01\
390-
\x20\x01(\x05R\x01A\x12\x0c\n\x01B\x18\x02\x20\x01(\x05R\x01B\"\x1a\n\nP\
391-
rotoReply\x12\x0c\n\x01C\x18\x01\x20\x01(\x05R\x01Cb\x06proto3\
389+
\n\x0barith.proto\x12\x06client\"'\n\tProtoArgs\x12\x0b\n\x01A\x18\x01\
390+
\x20\x01(\x05B\0\x12\x0b\n\x01B\x18\x02\x20\x01(\x05B\0:\0\"\x1b\n\nProt\
391+
oReply\x12\x0b\n\x01C\x18\x01\x20\x01(\x05B\0:\0B\0b\x06proto3\
392392
";
393393

394394
staticmut file_descriptor_proto_lazy:::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> =::protobuf::lazy::Lazy{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp