1
+ // This file is @generated by prost-build.
1
2
/// InstrumentRequest requests the stream of updates
2
3
/// to observe the async runtime state over time.
3
4
///
4
5
/// TODO: In the future allow for the request to specify
5
6
/// only the data that the caller cares about (i.e. only
6
7
/// tasks but no resources)
7
8
#[ allow( clippy:: derive_partial_eq_without_eq) ]
8
- #[ derive( Clone , PartialEq , :: prost:: Message ) ]
9
+ #[ derive( Clone , Copy , PartialEq , :: prost:: Message ) ]
9
10
pub struct InstrumentRequest { }
10
11
/// TaskDetailsRequest requests the stream of updates about
11
12
/// the specific task identified in the request.
12
13
#[ allow( clippy:: derive_partial_eq_without_eq) ]
13
- #[ derive( Clone , PartialEq , :: prost:: Message ) ]
14
+ #[ derive( Clone , Copy , PartialEq , :: prost:: Message ) ]
14
15
pub struct TaskDetailsRequest {
15
16
/// Identifies the task for which details were requested.
16
17
#[ prost( message, optional, tag = "1" ) ]
17
18
pub id : :: core:: option:: Option < super :: common:: Id > ,
18
19
}
19
20
/// PauseRequest requests the stream of updates to pause.
20
21
#[ allow( clippy:: derive_partial_eq_without_eq) ]
21
- #[ derive( Clone , PartialEq , :: prost:: Message ) ]
22
+ #[ derive( Clone , Copy , PartialEq , :: prost:: Message ) ]
22
23
pub struct PauseRequest { }
23
24
/// ResumeRequest requests the stream of updates to resume after a pause.
24
25
#[ allow( clippy:: derive_partial_eq_without_eq) ]
25
- #[ derive( Clone , PartialEq , :: prost:: Message ) ]
26
+ #[ derive( Clone , Copy , PartialEq , :: prost:: Message ) ]
26
27
pub struct ResumeRequest { }
27
28
/// Update carries all information regarding tasks, resources, async operations
28
29
/// and resource operations in one message. There are a couple of reasons to combine all
@@ -56,11 +57,11 @@ pub struct Update {
56
57
}
57
58
/// `PauseResponse` is the value returned after a pause request.
58
59
#[ allow( clippy:: derive_partial_eq_without_eq) ]
59
- #[ derive( Clone , PartialEq , :: prost:: Message ) ]
60
+ #[ derive( Clone , Copy , PartialEq , :: prost:: Message ) ]
60
61
pub struct PauseResponse { }
61
62
/// `ResumeResponse` is the value returned after a resume request.
62
63
#[ allow( clippy:: derive_partial_eq_without_eq) ]
63
- #[ derive( Clone , PartialEq , :: prost:: Message ) ]
64
+ #[ derive( Clone , Copy , PartialEq , :: prost:: Message ) ]
64
65
pub struct ResumeResponse { }
65
66
/// Generated client implementations.
66
67
pub mod instrument_client {
@@ -314,19 +315,17 @@ pub mod instrument_server {
314
315
/// `InstrumentServer<T>` implements `Instrument` as a service.
315
316
#[ derive( Debug ) ]
316
317
pub struct InstrumentServer < T : Instrument > {
317
- inner : _Inner < T > ,
318
+ inner : Arc < T > ,
318
319
accept_compression_encodings : EnabledCompressionEncodings ,
319
320
send_compression_encodings : EnabledCompressionEncodings ,
320
321
max_decoding_message_size : Option < usize > ,
321
322
max_encoding_message_size : Option < usize > ,
322
323
}
323
- struct _Inner < T > ( Arc < T > ) ;
324
324
impl < T : Instrument > InstrumentServer < T > {
325
325
pub fn new ( inner : T ) -> Self {
326
326
Self :: from_arc ( Arc :: new ( inner) )
327
327
}
328
328
pub fn from_arc ( inner : Arc < T > ) -> Self {
329
- let inner = _Inner ( inner) ;
330
329
Self {
331
330
inner,
332
331
accept_compression_encodings : Default :: default ( ) ,
@@ -389,7 +388,6 @@ pub mod instrument_server {
389
388
Poll :: Ready ( Ok ( ( ) ) )
390
389
}
391
390
fn call ( & mut self , req : http:: Request < B > ) -> Self :: Future {
392
- let inner = self . inner . clone ( ) ;
393
391
match req. uri ( ) . path ( ) {
394
392
"/rs.tokio.console.instrument.Instrument/WatchUpdates" => {
395
393
#[ allow( non_camel_case_types) ]
@@ -421,7 +419,6 @@ pub mod instrument_server {
421
419
let max_encoding_message_size = self . max_encoding_message_size ;
422
420
let inner = self . inner . clone ( ) ;
423
421
let fut = async move {
424
- let inner = inner. 0 ;
425
422
let method = WatchUpdatesSvc ( inner) ;
426
423
let codec = tonic:: codec:: ProstCodec :: default ( ) ;
427
424
let mut grpc = tonic:: server:: Grpc :: new ( codec)
@@ -468,7 +465,6 @@ pub mod instrument_server {
468
465
let max_encoding_message_size = self . max_encoding_message_size ;
469
466
let inner = self . inner . clone ( ) ;
470
467
let fut = async move {
471
- let inner = inner. 0 ;
472
468
let method = WatchTaskDetailsSvc ( inner) ;
473
469
let codec = tonic:: codec:: ProstCodec :: default ( ) ;
474
470
let mut grpc = tonic:: server:: Grpc :: new ( codec)
@@ -512,7 +508,6 @@ pub mod instrument_server {
512
508
let max_encoding_message_size = self . max_encoding_message_size ;
513
509
let inner = self . inner . clone ( ) ;
514
510
let fut = async move {
515
- let inner = inner. 0 ;
516
511
let method = PauseSvc ( inner) ;
517
512
let codec = tonic:: codec:: ProstCodec :: default ( ) ;
518
513
let mut grpc = tonic:: server:: Grpc :: new ( codec)
@@ -556,7 +551,6 @@ pub mod instrument_server {
556
551
let max_encoding_message_size = self . max_encoding_message_size ;
557
552
let inner = self . inner . clone ( ) ;
558
553
let fut = async move {
559
- let inner = inner. 0 ;
560
554
let method = ResumeSvc ( inner) ;
561
555
let codec = tonic:: codec:: ProstCodec :: default ( ) ;
562
556
let mut grpc = tonic:: server:: Grpc :: new ( codec)
@@ -578,8 +572,11 @@ pub mod instrument_server {
578
572
Ok (
579
573
http:: Response :: builder ( )
580
574
. status ( 200 )
581
- . header ( "grpc-status" , "12" )
582
- . header ( "content-type" , "application/grpc" )
575
+ . header ( "grpc-status" , tonic:: Code :: Unimplemented as i32 )
576
+ . header (
577
+ http:: header:: CONTENT_TYPE ,
578
+ tonic:: metadata:: GRPC_CONTENT_TYPE ,
579
+ )
583
580
. body ( empty_body ( ) )
584
581
. unwrap ( ) ,
585
582
)
@@ -600,16 +597,6 @@ pub mod instrument_server {
600
597
}
601
598
}
602
599
}
603
- impl < T : Instrument > Clone for _Inner < T > {
604
- fn clone ( & self ) -> Self {
605
- Self ( Arc :: clone ( & self . 0 ) )
606
- }
607
- }
608
- impl < T : std:: fmt:: Debug > std:: fmt:: Debug for _Inner < T > {
609
- fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
610
- write ! ( f, "{:?}" , self . 0 )
611
- }
612
- }
613
600
impl < T : Instrument > tonic:: server:: NamedService for InstrumentServer < T > {
614
601
const NAME : & ' static str = "rs.tokio.console.instrument.Instrument" ;
615
602
}
0 commit comments