about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-01-06T15·38+0100
committerflokli <flokli@flokli.de>2023-01-06T15·47+0000
commit144d010515c5a92c4a8ee05b95a913973f8bc6f2 (patch)
treea13a5f41a8a3b7eedb6480f587b820a2b7d1a1c9
parentc89af03a030b8447954d17972ce6f64fb6d42f57 (diff)
feat(tvix/store): document StorePath a bit more. r/5614
Change-Id: Ifab28d97ddc22a2073c5df5e6e2cefb51b4b9191
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7777
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
-rw-r--r--tvix/store/src/store_path.rs10
1 files changed, 10 insertions, 0 deletions
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],