about summary refs log tree commit diff
path: root/tvix/store/src/dummy_blob_service.rs
blob: 7731ea3344e3b63117ccc735fd756064fc4eece7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
use tokio_stream::wrappers::ReceiverStream;

use crate::proto::blob_service_server::BlobService;
use crate::proto::BlobChunk;
use crate::proto::BlobMeta;
use crate::proto::PutBlobResponse;
use crate::proto::ReadBlobRequest;
use crate::proto::StatBlobRequest;
use tonic::{Request, Response, Result, Status, Streaming};

pub struct DummyBlobService {}

#[tonic::async_trait]
impl BlobService for DummyBlobService {
    type ReadStream = ReceiverStream<Result<BlobChunk>>;

    async fn stat(&self, _request: Request<StatBlobRequest>) -> Result<Response<BlobMeta>> {
        Err(Status::unimplemented("not implemented"))
    }

    async fn read(
        &self,
        _request: Request<ReadBlobRequest>,
    ) -> Result<Response<Self::ReadStream>, Status> {
        Err(Status::unimplemented("not implemented"))
    }

    async fn put(
        &self,
        _request: Request<Streaming<BlobChunk>>,
    ) -> Result<Response<PutBlobResponse>> {
        Err(Status::unimplemented("not implemented"))
    }
}