about summary refs log blame commit diff
path: root/tvix/store/src/dummy_directory_service.rs
blob: e9b54d85afd43bf5ccc32aed31886d8035b58952 (plain) (tree)



























                                                             
use tokio_stream::wrappers::ReceiverStream;

use crate::proto::directory_service_server::DirectoryService;
use crate::proto::Directory;
use crate::proto::GetDirectoryRequest;
use crate::proto::PutDirectoryResponse;
use tonic::{Request, Response, Result, Status, Streaming};

pub struct DummyDirectoryService {}

#[tonic::async_trait]
impl DirectoryService for DummyDirectoryService {
    type GetStream = ReceiverStream<Result<Directory>>;

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

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