@@ -197,99 +197,109 @@ pub trait PeerSyncSvc<Z: NetworkZone>:
197
197
PeerSyncRequest < Z > ,
198
198
Response = PeerSyncResponse < Z > ,
199
199
Error = tower:: BoxError ,
200
- Future = Self :: Future2 ,
200
+ Future : Future < Output = Result < Self :: Response , Self :: Error > > + Send + ' static ,
201
201
> + Send
202
202
+ ' static
203
203
{
204
- // This allows us to put more restrictive bounds on the future without defining the future here
205
- // explicitly.
206
- type Future2 : Future < Output = Result < Self :: Response , Self :: Error > > + Send + ' static ;
207
204
}
208
205
209
- impl < T , Z : NetworkZone > PeerSyncSvc < Z > for T
210
- where
211
- T : tower:: Service < PeerSyncRequest < Z > , Response = PeerSyncResponse < Z > , Error = tower:: BoxError >
212
- + Send
213
- + ' static ,
214
- T :: Future : Future < Output = Result < Self :: Response , Self :: Error > > + Send + ' static ,
206
+ impl < T , Z : NetworkZone > PeerSyncSvc < Z > for T where
207
+ T : tower:: Service <
208
+ PeerSyncRequest < Z > ,
209
+ Response = PeerSyncResponse < Z > ,
210
+ Error = tower:: BoxError ,
211
+ Future : Future < Output = Result < Self :: Response , Self :: Error > > + Send + ' static ,
212
+ > + Send
213
+ + ' static
215
214
{
216
- type Future2 = T :: Future ;
217
215
}
218
216
219
217
pub trait AddressBook < Z : NetworkZone > :
220
218
tower:: Service <
221
219
AddressBookRequest < Z > ,
222
220
Response = AddressBookResponse < Z > ,
223
221
Error = tower:: BoxError ,
224
- Future = Self :: Future2 ,
222
+ Future : Future < Output = Result < Self :: Response , Self :: Error > > + Send + ' static ,
225
223
> + Send
226
224
+ ' static
227
225
{
228
- // This allows us to put more restrictive bounds on the future without defining the future here
229
- // explicitly.
230
- type Future2 : Future < Output = Result < Self :: Response , Self :: Error > > + Send + ' static ;
231
226
}
232
227
233
- impl < T , Z : NetworkZone > AddressBook < Z > for T
234
- where
228
+ impl < T , Z : NetworkZone > AddressBook < Z > for T where
235
229
T : tower:: Service <
236
230
AddressBookRequest < Z > ,
237
231
Response = AddressBookResponse < Z > ,
238
232
Error = tower:: BoxError ,
233
+ Future : Future < Output = Result < Self :: Response , Self :: Error > > + Send + ' static ,
239
234
> + Send
240
- + ' static ,
241
- T :: Future : Future < Output = Result < Self :: Response , Self :: Error > > + Send + ' static ,
235
+ + ' static
242
236
{
243
- type Future2 = T :: Future ;
244
237
}
245
238
246
239
pub trait CoreSyncSvc :
247
240
tower:: Service <
248
241
CoreSyncDataRequest ,
249
242
Response = CoreSyncDataResponse ,
250
243
Error = tower:: BoxError ,
251
- Future = Self :: Future2 ,
244
+ Future : Future < Output = Result < Self :: Response , Self :: Error > > + Send + ' static ,
252
245
> + Send
253
246
+ ' static
254
247
{
255
- // This allows us to put more restrictive bounds on the future without defining the future here
256
- // explicitly.
257
- type Future2 : Future < Output = Result < Self :: Response , Self :: Error > > + Send + ' static ;
258
248
}
259
249
260
- impl < T > CoreSyncSvc for T
261
- where
250
+ impl < T > CoreSyncSvc for T where
262
251
T : tower:: Service <
263
252
CoreSyncDataRequest ,
264
253
Response = CoreSyncDataResponse ,
265
254
Error = tower:: BoxError ,
255
+ Future : Future < Output = Result < Self :: Response , Self :: Error > > + Send + ' static ,
266
256
> + Send
267
- + ' static ,
268
- T :: Future : Future < Output = Result < Self :: Response , Self :: Error > > + Send + ' static ,
257
+ + ' static
269
258
{
270
- type Future2 = T :: Future ;
271
259
}
272
260
273
261
pub trait ProtocolRequestHandler :
274
262
tower:: Service <
275
263
ProtocolRequest ,
276
264
Response = ProtocolResponse ,
277
265
Error = tower:: BoxError ,
278
- Future = Self :: Future2 ,
266
+ Future : Future < Output = Result < Self :: Response , Self :: Error > > + Send + ' static ,
279
267
> + Send
280
268
+ ' static
281
269
{
282
- // This allows us to put more restrictive bounds on the future without defining the future here
283
- // explicitly.
284
- type Future2 : Future < Output = Result < Self :: Response , Self :: Error > > + Send + ' static ;
285
270
}
286
271
287
- impl < T > ProtocolRequestHandler for T
288
- where
289
- T : tower:: Service < ProtocolRequest , Response = ProtocolResponse , Error = tower:: BoxError >
290
- + Send
291
- + ' static ,
292
- T :: Future : Future < Output = Result < Self :: Response , Self :: Error > > + Send + ' static ,
272
+ impl < T > ProtocolRequestHandler for T where
273
+ T : tower:: Service <
274
+ ProtocolRequest ,
275
+ Response = ProtocolResponse ,
276
+ Error = tower:: BoxError ,
277
+ Future : Future < Output = Result < Self :: Response , Self :: Error > > + Send + ' static ,
278
+ > + Send
279
+ + ' static
280
+ {
281
+ }
282
+
283
+ pub trait ProtocolRequestHandlerMaker < Z : NetworkZone > :
284
+ tower:: MakeService <
285
+ client:: PeerInformation < Z :: Addr > ,
286
+ ProtocolRequest ,
287
+ MakeError = tower:: BoxError ,
288
+ Service : ProtocolRequestHandler ,
289
+ Future : Send + ' static ,
290
+ > + Send
291
+ + ' static
292
+ {
293
+ }
294
+
295
+ impl < T , Z : NetworkZone > ProtocolRequestHandlerMaker < Z > for T where
296
+ T : tower:: MakeService <
297
+ client:: PeerInformation < Z :: Addr > ,
298
+ ProtocolRequest ,
299
+ MakeError = tower:: BoxError ,
300
+ Service : ProtocolRequestHandler ,
301
+ Future : Send + ' static ,
302
+ > + Send
303
+ + ' static
293
304
{
294
- type Future2 = T :: Future ;
295
305
}
0 commit comments