feat(tvix/store/pathinfosvc): GRPCPathInfoService::from_client
Change-Id: I4a4f6f713dd76bf95f393c094c0eb9b6d15c5436 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8613 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: flokli <flokli@flokli.de>
This commit is contained in:
		
							parent
							
								
									8d392221c6
								
							
						
					
					
						commit
						7bd9df0133
					
				
					 1 changed files with 11 additions and 0 deletions
				
			
		| 
						 | 
					@ -25,6 +25,17 @@ impl GRPCPathInfoService {
 | 
				
			||||||
            grpc_client,
 | 
					            grpc_client,
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /// construct a [GRPCDirectoryService] from a [proto::path_info_service_client::PathInfoServiceClient<Channel>].
 | 
				
			||||||
 | 
					    /// panics if called outside the context of a tokio runtime.
 | 
				
			||||||
 | 
					    pub fn from_client(
 | 
				
			||||||
 | 
					        grpc_client: proto::path_info_service_client::PathInfoServiceClient<Channel>,
 | 
				
			||||||
 | 
					    ) -> Self {
 | 
				
			||||||
 | 
					        Self {
 | 
				
			||||||
 | 
					            tokio_handle: tokio::runtime::Handle::current(),
 | 
				
			||||||
 | 
					            grpc_client,
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
impl PathInfoService for GRPCPathInfoService {
 | 
					impl PathInfoService for GRPCPathInfoService {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue