File tree Expand file tree Collapse file tree 5 files changed +12
-11
lines changed Expand file tree Collapse file tree 5 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -26,8 +26,8 @@ as a Rust trait.
26
26
27
27
# Required dependencies
28
28
``` toml
29
- tonic = " 0.4 "
30
- tonic-rpc = { version = " 0.1 " , features = [ <enabled-codecs> ] }
29
+ tonic = " 0.8 "
30
+ tonic-rpc = { version = " 0.2 " , features = [ <enabled-codecs> ] }
31
31
```
32
32
33
33
# Example
@@ -96,7 +96,7 @@ E.g. To use the encode using `cbor`, use the attribute
96
96
```
97
97
and include
98
98
``` toml
99
- tonic-rpc = { version = " 0.1 " , features = [ " cbor" ]}
99
+ tonic-rpc = { version = " 0.2 " , features = [ " cbor" ]}
100
100
```
101
101
in ` Cargo.toml ` .
102
102
Original file line number Diff line number Diff line change @@ -19,6 +19,6 @@ proc-macro = true
19
19
heck = " 0.4"
20
20
itertools = " 0.10"
21
21
syn = { version = " 1.0" , features = [" full" ] }
22
- tonic-build = " 0.7 "
22
+ tonic-build = " 0.8 "
23
23
proc-macro2 = " 1.0"
24
24
quote = " 1.0"
Original file line number Diff line number Diff line change @@ -77,9 +77,11 @@ macro_rules! method_impl {
77
77
}
78
78
79
79
impl Method for $name {
80
- const CODEC_PATH : & ' static str = $codec;
81
80
type Comment = String ;
82
81
82
+ fn codec_path( & self ) -> & str {
83
+ $codec
84
+ }
83
85
fn name( & self ) -> & str {
84
86
self . 0 . name( )
85
87
}
@@ -121,7 +123,6 @@ struct RustDefService<T> {
121
123
macro_rules! service_impl {
122
124
( $name: ident, $codec: expr) => {
123
125
impl Service for RustDefService <$name> {
124
- const CODEC_PATH : & ' static str = $codec;
125
126
type Comment = String ;
126
127
type Method = $name;
127
128
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ messagepack = ["rmp-serde"]
24
24
[dependencies ]
25
25
bytes = " 1.0"
26
26
serde = { version = " 1.0" , features = [" derive" ] }
27
- tonic = " 0.7 "
27
+ tonic = " 0.8 "
28
28
tonic-rpc-macro = { version = " 0.2" , path = " ../tonic-rpc-macro" }
29
29
30
30
# optional codecs
@@ -39,7 +39,7 @@ tokio = { version = "1.4", features = [ "full" ] }
39
39
tokio-stream = { version = " 0.1" , features = [ " net" ] }
40
40
41
41
[build-dependencies ]
42
- tonic-build = " 0.7 "
42
+ tonic-build = " 0.8 "
43
43
44
44
# docs.rs-specific configuration
45
45
[package .metadata .docs .rs ]
Original file line number Diff line number Diff line change 11
11
//!
12
12
//! # Required dependencies
13
13
//! ```toml
14
- //! tonic = "0.4 "
15
- //! tonic-rpc = { version = "0.1 ", features = [ <enabled-codecs> ] }
14
+ //! tonic = "0.8 "
15
+ //! tonic-rpc = { version = "0.2 ", features = [ <enabled-codecs> ] }
16
16
//! ```
17
17
//!
18
18
//! # Example
114
114
//! ```
115
115
//! and include
116
116
//! ```toml
117
- //! tonic-rpc = { version = "0.1 ", features = [ "cbor" ]}
117
+ //! tonic-rpc = { version = "0.2 ", features = [ "cbor" ]}
118
118
//! ```
119
119
//! in `Cargo.toml`.
120
120
//!
You can’t perform that action at this time.
0 commit comments