about summary refs log blame commit diff
path: root/tvix/store/src/dummy_path_info_service.rs
blob: 93359377f3dc6c6a37b09b6b78ca94192f47b515 (plain) (tree)
1
2
3
4
5
6
7
8
9
10





                                                            
                                


                                  

                                                    

                                               
                             
                                                                                              

                                                       

     
                             
                                                                                    

                                                       

     
                             



                                                 

                                                       

     
use crate::proto::path_info_service_server::PathInfoService;
use crate::proto::CalculateNarResponse;
use crate::proto::GetPathInfoRequest;
use crate::proto::Node;
use crate::proto::PathInfo;
use tonic::{Request, Response, Result, Status};
use tracing::{instrument, warn};

pub struct DummyPathInfoService {}

const NOT_IMPLEMENTED_MSG: &str = "not implemented";

#[tonic::async_trait]
impl PathInfoService for DummyPathInfoService {
    #[instrument(skip(self))]
    async fn get(&self, _request: Request<GetPathInfoRequest>) -> Result<Response<PathInfo>> {
        warn!(NOT_IMPLEMENTED_MSG);
        Err(Status::unimplemented(NOT_IMPLEMENTED_MSG))
    }

    #[instrument(skip(self))]
    async fn put(&self, _request: Request<PathInfo>) -> Result<Response<PathInfo>> {
        warn!(NOT_IMPLEMENTED_MSG);
        Err(Status::unimplemented(NOT_IMPLEMENTED_MSG))
    }

    #[instrument(skip(self))]
    async fn calculate_nar(
        &self,
        _request: Request<Node>,
    ) -> Result<Response<CalculateNarResponse>> {
        warn!(NOT_IMPLEMENTED_MSG);
        Err(Status::unimplemented(NOT_IMPLEMENTED_MSG))
    }
}