File tree Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 1
1
[package ]
2
2
name = " rust_pajamax"
3
- version = " 0.1 .0"
3
+ version = " 0.2 .0"
4
4
authors = [" Wu Bingzheng <wubingzheng@gmail.com>" ]
5
5
edition = " 2021"
6
6
license = " MIT"
@@ -10,9 +10,9 @@ name = "helloworld"
10
10
path = " src/helloworld.rs"
11
11
12
12
[dependencies ]
13
- pajamax = " 0.1.1 "
13
+ pajamax = " 0.2.0 "
14
14
prost = " 0.13.5"
15
15
16
16
[build-dependencies ]
17
- pajamax-build = " 0.1 .0"
17
+ pajamax-build = " 0.2 .0"
18
18
prost-build = " 0.13.5"
Original file line number Diff line number Diff line change 1
1
fn main ( ) -> Result < ( ) , Box < dyn std:: error:: Error > > {
2
- pajamax_build:: compile_protos ( & [ "proto/helloworld/helloworld.proto" ] , & [ "." ] ) ?;
2
+ pajamax_build:: compile_protos_in_local ( & [ "proto/helloworld/helloworld.proto" ] , & [ "." ] ) ?;
3
3
Ok ( ( ) )
4
4
}
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ mod helloworld {
14
14
}
15
15
16
16
// define your business context
17
+ #[ derive( Clone ) ]
17
18
struct MyGreeter ( ) ;
18
19
19
20
// `Greeter` trait defines all methods in gRPC server
@@ -22,7 +23,7 @@ impl Greeter for MyGreeter {
22
23
// - `fn` but not `async fn`
23
24
// - `HelloRequest` but not `Request<HelloRequest>`
24
25
// - `HelloReply` but not `Response<HelloReply>`
25
- fn say_hello ( & self , req : HelloRequest ) -> Result < HelloReply , Status > {
26
+ fn say_hello ( & mut self , req : HelloRequest ) -> Result < HelloReply , Status > {
26
27
let reply = HelloReply {
27
28
response : req. request ,
28
29
} ;
@@ -39,5 +40,5 @@ fn main() {
39
40
// start the server
40
41
// By now we have not support configurations and multiple service,
41
42
// so this API is simpler than tonic's.
42
- pajamax:: serve ( GreeterServer :: new ( greeter) , addr) . unwrap ( ) ;
43
+ pajamax:: serve_local ( GreeterServer :: new ( greeter) , addr) . unwrap ( ) ;
43
44
}
You can’t perform that action at this time.
0 commit comments