File tree Expand file tree Collapse file tree 7 files changed +37
-3
lines changed
tests/service_named_service Expand file tree Collapse file tree 7 files changed +37
-3
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ members = [
14
14
# Tests
15
15
" tests/included_service" ,
16
16
" tests/same_name" ,
17
+ " tests/service_named_service" ,
17
18
" tests/wellknown" ,
18
19
" tests/wellknown-compiled" ,
19
20
" tests/extern_path/uuid" ,
Original file line number Diff line number Diff line change
1
+ [package ]
2
+ name = " service_named_service"
3
+ version = " 0.1.0"
4
+ authors = [" Lucio Franco <luciofranco14@gmail.com>" ]
5
+ edition = " 2018"
6
+ publish = false
7
+ license = " MIT"
8
+
9
+ # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
10
+
11
+ [dependencies ]
12
+ tonic = { path = " ../../tonic" }
13
+ prost = " 0.8"
14
+
15
+ [build-dependencies ]
16
+ tonic-build = { path = " ../../tonic-build" }
Original file line number Diff line number Diff line change
1
+ fn main ( ) {
2
+ tonic_build:: compile_protos ( "proto/foo.proto" ) . unwrap ( ) ;
3
+ }
Original file line number Diff line number Diff line change
1
+ syntax = "proto3" ;
2
+
3
+ package foo ;
4
+
5
+ service Service {
6
+ rpc Foo (stream FooRequest ) returns (stream FooResponse ) {}
7
+ }
8
+
9
+ message FooRequest {}
10
+
11
+ message FooResponse {}
Original file line number Diff line number Diff line change
1
+ pub mod pb {
2
+ tonic:: include_proto!( "foo" ) ;
3
+ }
Original file line number Diff line number Diff line change @@ -69,11 +69,11 @@ pub fn generate<T: Service>(
69
69
pub fn with_interceptor<F >( inner: T , interceptor: F ) -> #service_ident<InterceptedService <T , F >>
70
70
where
71
71
F : FnMut ( tonic:: Request <( ) >) -> Result <tonic:: Request <( ) >, tonic:: Status >,
72
- T : Service <
72
+ T : tonic :: codegen :: Service <
73
73
http:: Request <tonic:: body:: BoxBody >,
74
74
Response = http:: Response <<T as tonic:: client:: GrpcService <tonic:: body:: BoxBody >>:: ResponseBody >
75
75
>,
76
- <T as Service <http:: Request <tonic:: body:: BoxBody >>>:: Error : Into <StdError > + Send + Sync ,
76
+ <T as tonic :: codegen :: Service <http:: Request <tonic:: body:: BoxBody >>>:: Error : Into <StdError > + Send + Sync ,
77
77
{
78
78
#service_ident:: new( InterceptedService :: new( inner, interceptor) )
79
79
}
Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ pub fn generate<T: Service>(
112
112
#configure_compression_methods
113
113
}
114
114
115
- impl <T , B > Service <http:: Request <B >> for #server_service<T >
115
+ impl <T , B > tonic :: codegen :: Service <http:: Request <B >> for #server_service<T >
116
116
where
117
117
T : #server_trait,
118
118
B : Body + Send + Sync + ' static ,
You can’t perform that action at this time.
0 commit comments