1
+ // This file is @generated by prost-build.
1
2
/// Generated client implementations.
2
3
pub mod driver_communication_client {
3
- #![ allow( unused_variables, dead_code, missing_docs, clippy:: let_unit_value) ]
4
+ #![ allow(
5
+ unused_variables,
6
+ dead_code,
7
+ missing_docs,
8
+ clippy:: wildcard_imports,
9
+ clippy:: let_unit_value,
10
+ ) ]
4
11
use tonic:: codegen:: * ;
5
12
use tonic:: codegen:: http:: Uri ;
6
13
#[ derive( Debug , Clone ) ]
@@ -22,8 +29,8 @@ pub mod driver_communication_client {
22
29
where
23
30
T : tonic:: client:: GrpcService < tonic:: body:: BoxBody > ,
24
31
T :: Error : Into < StdError > ,
25
- T :: ResponseBody : Body < Data = Bytes > + Send + ' static ,
26
- <T :: ResponseBody as Body >:: Error : Into < StdError > + Send ,
32
+ T :: ResponseBody : Body < Data = Bytes > + std :: marker :: Send + ' static ,
33
+ <T :: ResponseBody as Body >:: Error : Into < StdError > + std :: marker :: Send ,
27
34
{
28
35
pub fn new ( inner : T ) -> Self {
29
36
let inner = tonic:: client:: Grpc :: new ( inner) ;
@@ -48,7 +55,7 @@ pub mod driver_communication_client {
48
55
> ,
49
56
<T as tonic:: codegen:: Service <
50
57
http:: Request < tonic:: body:: BoxBody > ,
51
- > >:: Error : Into < StdError > + Send + Sync ,
58
+ > >:: Error : Into < StdError > + std :: marker :: Send + std :: marker :: Sync ,
52
59
{
53
60
DriverCommunicationClient :: new ( InterceptedService :: new ( inner, interceptor) )
54
61
}
@@ -96,8 +103,7 @@ pub mod driver_communication_client {
96
103
. ready ( )
97
104
. await
98
105
. map_err ( |e| {
99
- tonic:: Status :: new (
100
- tonic:: Code :: Unknown ,
106
+ tonic:: Status :: unknown (
101
107
format ! ( "Service was not ready: {}" , e. into( ) ) ,
102
108
)
103
109
} ) ?;
@@ -119,11 +125,17 @@ pub mod driver_communication_client {
119
125
}
120
126
/// Generated server implementations.
121
127
pub mod driver_communication_server {
122
- #![ allow( unused_variables, dead_code, missing_docs, clippy:: let_unit_value) ]
128
+ #![ allow(
129
+ unused_variables,
130
+ dead_code,
131
+ missing_docs,
132
+ clippy:: wildcard_imports,
133
+ clippy:: let_unit_value,
134
+ ) ]
123
135
use tonic:: codegen:: * ;
124
136
/// Generated trait containing gRPC methods that should be implemented for use with DriverCommunicationServer.
125
137
#[ async_trait]
126
- pub trait DriverCommunication : Send + Sync + ' static {
138
+ pub trait DriverCommunication : std :: marker :: Send + std :: marker :: Sync + ' static {
127
139
/// the remote relay sends a RequestDriverState request to its driver with a
128
140
/// query defining the data it wants to receive
129
141
async fn request_driver_state (
@@ -135,20 +147,18 @@ pub mod driver_communication_server {
135
147
> ;
136
148
}
137
149
#[ derive( Debug ) ]
138
- pub struct DriverCommunicationServer < T : DriverCommunication > {
139
- inner : _Inner < T > ,
150
+ pub struct DriverCommunicationServer < T > {
151
+ inner : Arc < T > ,
140
152
accept_compression_encodings : EnabledCompressionEncodings ,
141
153
send_compression_encodings : EnabledCompressionEncodings ,
142
154
max_decoding_message_size : Option < usize > ,
143
155
max_encoding_message_size : Option < usize > ,
144
156
}
145
- struct _Inner < T > ( Arc < T > ) ;
146
- impl < T : DriverCommunication > DriverCommunicationServer < T > {
157
+ impl < T > DriverCommunicationServer < T > {
147
158
pub fn new ( inner : T ) -> Self {
148
159
Self :: from_arc ( Arc :: new ( inner) )
149
160
}
150
161
pub fn from_arc ( inner : Arc < T > ) -> Self {
151
- let inner = _Inner ( inner) ;
152
162
Self {
153
163
inner,
154
164
accept_compression_encodings : Default :: default ( ) ,
@@ -198,8 +208,8 @@ pub mod driver_communication_server {
198
208
impl < T , B > tonic:: codegen:: Service < http:: Request < B > > for DriverCommunicationServer < T >
199
209
where
200
210
T : DriverCommunication ,
201
- B : Body + Send + ' static ,
202
- B :: Error : Into < StdError > + Send + ' static ,
211
+ B : Body + std :: marker :: Send + ' static ,
212
+ B :: Error : Into < StdError > + std :: marker :: Send + ' static ,
203
213
{
204
214
type Response = http:: Response < tonic:: body:: BoxBody > ;
205
215
type Error = std:: convert:: Infallible ;
@@ -211,7 +221,6 @@ pub mod driver_communication_server {
211
221
Poll :: Ready ( Ok ( ( ) ) )
212
222
}
213
223
fn call ( & mut self , req : http:: Request < B > ) -> Self :: Future {
214
- let inner = self . inner . clone ( ) ;
215
224
match req. uri ( ) . path ( ) {
216
225
"/driver.driver.DriverCommunication/RequestDriverState" => {
217
226
#[ allow( non_camel_case_types) ]
@@ -249,7 +258,6 @@ pub mod driver_communication_server {
249
258
let max_encoding_message_size = self . max_encoding_message_size ;
250
259
let inner = self . inner . clone ( ) ;
251
260
let fut = async move {
252
- let inner = inner. 0 ;
253
261
let method = RequestDriverStateSvc ( inner) ;
254
262
let codec = tonic:: codec:: ProstCodec :: default ( ) ;
255
263
let mut grpc = tonic:: server:: Grpc :: new ( codec)
@@ -268,20 +276,25 @@ pub mod driver_communication_server {
268
276
}
269
277
_ => {
270
278
Box :: pin ( async move {
271
- Ok (
272
- http:: Response :: builder ( )
273
- . status ( 200 )
274
- . header ( "grpc-status" , "12" )
275
- . header ( "content-type" , "application/grpc" )
276
- . body ( empty_body ( ) )
277
- . unwrap ( ) ,
278
- )
279
+ let mut response = http:: Response :: new ( empty_body ( ) ) ;
280
+ let headers = response. headers_mut ( ) ;
281
+ headers
282
+ . insert (
283
+ tonic:: Status :: GRPC_STATUS ,
284
+ ( tonic:: Code :: Unimplemented as i32 ) . into ( ) ,
285
+ ) ;
286
+ headers
287
+ . insert (
288
+ http:: header:: CONTENT_TYPE ,
289
+ tonic:: metadata:: GRPC_CONTENT_TYPE ,
290
+ ) ;
291
+ Ok ( response)
279
292
} )
280
293
}
281
294
}
282
295
}
283
296
}
284
- impl < T : DriverCommunication > Clone for DriverCommunicationServer < T > {
297
+ impl < T > Clone for DriverCommunicationServer < T > {
285
298
fn clone ( & self ) -> Self {
286
299
let inner = self . inner . clone ( ) ;
287
300
Self {
@@ -293,18 +306,9 @@ pub mod driver_communication_server {
293
306
}
294
307
}
295
308
}
296
- impl < T : DriverCommunication > Clone for _Inner < T > {
297
- fn clone ( & self ) -> Self {
298
- Self ( Arc :: clone ( & self . 0 ) )
299
- }
300
- }
301
- impl < T : std:: fmt:: Debug > std:: fmt:: Debug for _Inner < T > {
302
- fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
303
- write ! ( f, "{:?}" , self . 0 )
304
- }
305
- }
306
- impl < T : DriverCommunication > tonic:: server:: NamedService
307
- for DriverCommunicationServer < T > {
308
- const NAME : & ' static str = "driver.driver.DriverCommunication" ;
309
+ /// Generated gRPC service name
310
+ pub const SERVICE_NAME : & str = "driver.driver.DriverCommunication" ;
311
+ impl < T > tonic:: server:: NamedService for DriverCommunicationServer < T > {
312
+ const NAME : & ' static str = SERVICE_NAME ;
309
313
}
310
314
}
0 commit comments