refactor(tvix/*store): remove some trait bounds

We don't need to require these things for these impl blocks yet.

Change-Id: I3cec958a637a4f900bdd38abd00e9133bf75ce46
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11865
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: Simon Hauser <simon.hauser@helsinki-systems.de>
Tested-by: BuildkiteCI
This commit is contained in:
Florian Klink 2024-06-20 20:57:32 +03:00 committed by flokli
parent 639a00e2ab
commit 7f625e2fc1
3 changed files with 6 additions and 24 deletions

View file

@ -22,19 +22,13 @@ use tracing::{instrument, Instrument as _};
/// Connects to a (remote) tvix-store BlobService over gRPC. /// Connects to a (remote) tvix-store BlobService over gRPC.
#[derive(Clone)] #[derive(Clone)]
pub struct GRPCBlobService<T> pub struct GRPCBlobService<T> {
where
T: Clone,
{
/// The internal reference to a gRPC client. /// The internal reference to a gRPC client.
/// Cloning it is cheap, and it internally handles concurrent requests. /// Cloning it is cheap, and it internally handles concurrent requests.
grpc_client: proto::blob_service_client::BlobServiceClient<T>, grpc_client: proto::blob_service_client::BlobServiceClient<T>,
} }
impl<T> GRPCBlobService<T> impl<T> GRPCBlobService<T> {
where
T: tonic::client::GrpcService<tonic::body::BoxBody> + Clone,
{
/// construct a [GRPCBlobService] from a [proto::blob_service_client::BlobServiceClient]. /// construct a [GRPCBlobService] from a [proto::blob_service_client::BlobServiceClient].
/// panics if called outside the context of a tokio runtime. /// panics if called outside the context of a tokio runtime.
pub fn from_client(grpc_client: proto::blob_service_client::BlobServiceClient<T>) -> Self { pub fn from_client(grpc_client: proto::blob_service_client::BlobServiceClient<T>) -> Self {

View file

@ -14,19 +14,13 @@ use tracing::{instrument, warn, Instrument as _};
/// Connects to a (remote) tvix-store DirectoryService over gRPC. /// Connects to a (remote) tvix-store DirectoryService over gRPC.
#[derive(Clone)] #[derive(Clone)]
pub struct GRPCDirectoryService<T> pub struct GRPCDirectoryService<T> {
where
T: Clone,
{
/// The internal reference to a gRPC client. /// The internal reference to a gRPC client.
/// Cloning it is cheap, and it internally handles concurrent requests. /// Cloning it is cheap, and it internally handles concurrent requests.
grpc_client: proto::directory_service_client::DirectoryServiceClient<T>, grpc_client: proto::directory_service_client::DirectoryServiceClient<T>,
} }
impl<T> GRPCDirectoryService<T> impl<T> GRPCDirectoryService<T> {
where
T: tonic::client::GrpcService<tonic::body::BoxBody> + Clone,
{
/// construct a [GRPCDirectoryService] from a [proto::directory_service_client::DirectoryServiceClient]. /// construct a [GRPCDirectoryService] from a [proto::directory_service_client::DirectoryServiceClient].
/// panics if called outside the context of a tokio runtime. /// panics if called outside the context of a tokio runtime.
pub fn from_client( pub fn from_client(

View file

@ -13,19 +13,13 @@ use tvix_castore::{proto as castorepb, Error};
/// Connects to a (remote) tvix-store PathInfoService over gRPC. /// Connects to a (remote) tvix-store PathInfoService over gRPC.
#[derive(Clone)] #[derive(Clone)]
pub struct GRPCPathInfoService<T> pub struct GRPCPathInfoService<T> {
where
T: Clone,
{
/// The internal reference to a gRPC client. /// The internal reference to a gRPC client.
/// Cloning it is cheap, and it internally handles concurrent requests. /// Cloning it is cheap, and it internally handles concurrent requests.
grpc_client: proto::path_info_service_client::PathInfoServiceClient<T>, grpc_client: proto::path_info_service_client::PathInfoServiceClient<T>,
} }
impl<T> GRPCPathInfoService<T> impl<T> GRPCPathInfoService<T> {
where
T: tonic::client::GrpcService<tonic::body::BoxBody> + Clone,
{
/// construct a [GRPCPathInfoService] from a [proto::path_info_service_client::PathInfoServiceClient]. /// construct a [GRPCPathInfoService] from a [proto::path_info_service_client::PathInfoServiceClient].
/// panics if called outside the context of a tokio runtime. /// panics if called outside the context of a tokio runtime.
pub fn from_client( pub fn from_client(