File tree Expand file tree Collapse file tree 5 files changed +30
-7
lines changed Expand file tree Collapse file tree 5 files changed +30
-7
lines changed Original file line number Diff line number Diff line change 1
1
[package ]
2
2
name = " ttrpc"
3
- version = " 0.4.14 "
3
+ version = " 0.5.0 "
4
4
authors = [" The AntFin Kata Team <kata@list.alibaba-inc.com>" ]
5
5
edition = " 2018"
6
6
license = " Apache-2.0"
Original file line number Diff line number Diff line change 1
1
[package ]
2
2
name = " ttrpc-compiler"
3
- version = " 0.3.2 "
3
+ version = " 0.4.0 "
4
4
edition = " 2018"
5
5
authors = [" The AntFin Kata Team <kata@list.alibaba-inc.com>" ]
6
6
license = " Apache-2.0"
Original file line number Diff line number Diff line change @@ -6,3 +6,9 @@ generate rust version ttrpc code from proto files.
6
6
7
7
- [ Manual Generation] ( https://github.com/containerd/ttrpc-rust#1-generate-with-protoc-command ) uses ttrpc-compiler as a protoc plugin
8
8
- [ Programmatic Generation] ( https://github.com/containerd/ttrpc-rust#2-generate-programmatically ) uses ttrpc-compiler as a rust crate
9
+
10
+ ## Versions
11
+ | ttrpc-compiler version | ttrpc version |
12
+ | ------------- | ------------- |
13
+ | 0.3.x | <= 0.4.x |
14
+ | 0.4.x | >= 0.5.x
Original file line number Diff line number Diff line change 1
1
[package ]
2
2
name = " ttrpc-codegen"
3
- version = " 0.1.2 "
3
+ version = " 0.2.0 "
4
4
edition = " 2018"
5
5
authors = [" The AntFin Kata Team <kata@list.alibaba-inc.com>" ]
6
6
license = " Apache-2.0"
Original file line number Diff line number Diff line change 2
2
3
3
API to generate ` .rs ` files to be used e. g. [ from build.rs] ( ../example/build.rs ) .
4
4
5
- Example code:
5
+ ## Example
6
+
7
+ build.rs:
6
8
7
9
``` rust
8
10
use ttrpc_codegen :: Codegen ;
9
- use ttrpc_codegen :: Customize ;
11
+ use ttrpc_codegen :: { Customize , ProtobufCustomize } ;
10
12
11
13
fn main () {
14
+ let protos = vec! [
15
+ " protos/a.proto" ,
16
+ " protos/b.proto" ,
17
+ ];
18
+
12
19
Codegen :: new ()
13
20
. out_dir (" protocols/sync" )
14
21
. inputs (& protos )
@@ -17,19 +24,29 @@ fn main() {
17
24
. customize (Customize {
18
25
.. Default :: default ()
19
26
})
27
+ . rust_protobuf_customize (ProtobufCustomize {
28
+ .. Default :: default ()
29
+ }
20
30
. run ()
21
31
. expect (" Gen code failed." );
22
32
}
23
33
24
34
```
25
35
26
- And in ` Cargo.toml ` :
36
+ Cargo . toml:
27
37
28
38
```
29
39
[build - dependencies ]
30
- ttrpc-codegen = "0.3 "
40
+ ttrpc - codegen = " 0.2 "
31
41
```
32
42
43
+ ## Versions
44
+ | ttrpc - codegen version | ttrpc version |
45
+ | ------------- | ------------- |
46
+ | 0.1 . x | <= 0.4 . x |
47
+ | 0.2 . x | >= 0.5 . x |
48
+
49
+ ## Alternative
33
50
The alternative is to use
34
51
[protoc - rust crate ](https : // github.com/stepancheg/rust-protobuf/tree/master/protoc-rust),
35
52
which relies on `protoc ` command to parse descriptors . Both crates should produce the same result ,
You can’t perform that action at this time.
0 commit comments