From 144d010515c5a92c4a8ee05b95a913973f8bc6f2 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Fri, 6 Jan 2023 16:38:26 +0100 Subject: feat(tvix/store): document StorePath a bit more. Change-Id: Ifab28d97ddc22a2073c5df5e6e2cefb51b4b9191 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7777 Tested-by: BuildkiteCI Reviewed-by: tazjin --- tvix/store/src/store_path.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tvix/store/src/store_path.rs b/tvix/store/src/store_path.rs index 1d767e3519ac..b63f134bcea2 100644 --- a/tvix/store/src/store_path.rs +++ b/tvix/store/src/store_path.rs @@ -26,6 +26,16 @@ pub enum ParseStorePathError { MissingStoreDir(), } +/// Represents a path in the Nix store (a direct child of [STORE_DIR]). +/// +/// It starts with a digest (20 bytes), [struct@NIXBASE32]-encoded, followed by +/// a `-`, and ends with a `name`, which is a string, consisting only of ASCCI +/// alphanumeric characters, or one of the following characters: `-`, `_`, `.`, +/// `+`, `?`, `=`. +/// +/// The name is usually used to describe the pname and version of a package. +/// Derivations paths can also be represented as store paths, they end +/// with .drv. #[derive(Debug, PartialEq, Eq)] pub struct StorePath { pub digest: [u8; DIGEST_SIZE], -- cgit 1.4.1