Skip to main content

Module store_path

Module store_path 

Source

Modules§

borrowed 🔒
utils 🔒

Structs§

StorePath
Represents a path in the Nix store (a direct child of STORE_DIR).
StorePathRef
Like StorePath, but with a &str for the name.

Enums§

ParseStorePathError
Errors that can occur when parsing a literal store path
ParseStorePathNameError
Error returned by validate_name.

Constants§

DIGEST_SIZE
ENCODED_DIGEST_SIZE
STORE_DIR
STORE_DIR_WITH_SLASH

Statics§

NAME_CHARS 🔒
NAME_CHARS contains true for bytes that are valid in store path names.

Functions§

build_ca_path
This builds a store path for a content-addressed path (used for fetches and FODs).
build_output_path
Builds an input-addressed store path.
build_text_path
This builds a store path, for a CAHash::Text type store path. If you don’t want to have to pass the entire contents, you might want to use build_text_path_from_content_digest instead.
build_text_path_from_content_digest
This builds a store path, for a CAHash::Text type store path. content_digest needs to be the sha256 digest of the contents. If you have the contents as a byte slice, you can also use build_text_path.
compress_hash
compress_hash takes an arbitrarily long sequence of bytes (usually a hash digest), and returns a sequence of bytes of length OUTPUT_SIZE.
hash_placeholder
Nix placeholders (i.e. values returned by builtins.placeholder) are used to populate outputs with paths that must be string-replaced with the actual placeholders later, at runtime.
validate_name
Checks a given &u8 to match the restrictions for StorePath::name, and returns the name as &str if successful.
validate_name_as_os_str
Checks a given OsStr to match the restrictions for StorePath::name, and returns the name as &str if successful.