Function tvix_store::pathinfoservice::from_addr::from_addr

source ยท
pub async fn from_addr(
    uri: &str,
    context: Option<&CompositionContext<'_>>,
) -> Result<Arc<dyn PathInfoService>, Box<dyn Error + Send + Sync>>
Expand description

Constructs a new instance of a PathInfoService from an URI.

The following URIs are supported:

  • memory: Uses a in-memory implementation.
  • redb: Uses a in-memory redb implementation.
  • redb:///absolute/path/to/somewhere Uses redb, using a path on the disk for persistency. Can be only opened from one process at the same time.
  • nix+https://cache.nixos.org?trusted-public-keys=cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= Exposes the Nix binary cache as a PathInfoService, ingesting NARs into the {Blob,Directory}Service. You almost certainly want to use this with some cache. The trusted-public-keys URL parameter can be provided, which will then enable signature verification.
  • grpc+unix:///absolute/path/to/somewhere Connects to a local tvix-store gRPC service via Unix socket.
  • grpc+http://host:port, grpc+https://host:port Connects to a (remote) tvix-store gRPC service.

As the PathInfoService needs to talk to [BlobService] and [DirectoryService], these also need to be passed in.