pub trait PathInfoService: Send + Sync + 'static {
    type ListStream: Stream<Item = Result<PathInfo, Status>> + Send + 'static;

    // Required methods
    fn get<'life0, 'async_trait>(
        &'life0 self,
        request: Request<GetPathInfoRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<PathInfo>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn put<'life0, 'async_trait>(
        &'life0 self,
        request: Request<PathInfo>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<PathInfo>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn calculate_nar<'life0, 'async_trait>(
        &'life0 self,
        request: Request<Node>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<CalculateNarResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn list<'life0, 'async_trait>(
        &'life0 self,
        request: Request<ListPathInfoRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Self::ListStream>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Generated trait containing gRPC methods that should be implemented for use with PathInfoServiceServer.

Required Associated Types§

source

type ListStream: Stream<Item = Result<PathInfo, Status>> + Send + 'static

Server streaming response type for the List method.

Required Methods§

source

fn get<'life0, 'async_trait>( &'life0 self, request: Request<GetPathInfoRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<PathInfo>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return a PathInfo message matching the criteria specified in the GetPathInfoRequest message.

source

fn put<'life0, 'async_trait>( &'life0 self, request: Request<PathInfo>, ) -> Pin<Box<dyn Future<Output = Result<Response<PathInfo>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Upload a PathInfo object to the remote end. It MUST not return until the PathInfo object has been written on the the remote end.

The remote end MAY check if a potential DirectoryNode has already been uploaded.

Uploading clients SHOULD obviously not steer other machines to try to substitute before from the remote end before having finished uploading PathInfo, Directories and Blobs. The returned PathInfo object MAY contain additional narinfo signatures, but is otherwise left untouched.

source

fn calculate_nar<'life0, 'async_trait>( &'life0 self, request: Request<Node>, ) -> Pin<Box<dyn Future<Output = Result<Response<CalculateNarResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Calculate the NAR representation of the contents specified by the root_node. The calculation SHOULD be cached server-side for subsequent requests.

All references (to blobs or Directory messages) MUST already exist in the store.

The method can be used to produce a Nix fixed-output path, which contains the (compressed) sha256 of the NAR content representation in the root_node name (suffixed with the name).

It can also be used to calculate arbitrary NAR hashes of output paths, in case a legacy Nix Binary Cache frontend is provided.

source

fn list<'life0, 'async_trait>( &'life0 self, request: Request<ListPathInfoRequest>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::ListStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return a stream of PathInfo messages matching the criteria specified in ListPathInfoRequest.

Implementors§

source§

impl<PS, NS> PathInfoService for GRPCPathInfoServiceWrapper<PS, NS>
where PS: Deref<Target = dyn PathInfoService> + Send + Sync + 'static, NS: NarCalculationService + Send + Sync + 'static,

§

type ListStream = Pin<Box<dyn Stream<Item = Result<PathInfo, Status>> + Send>>