Skip to main content

Module util

Module util 

Source
Expand description

Shared utility functions

Functions§

atomic_write
Atomically write content to a file using temp + rename.
atomic_write_str
Atomically write string content to a file.
cbor_to_vec
Serialize a value to CBOR bytes.
configure_walker
Configure a WalkBuilder for void’s ignore semantics.
count_lines
Count the number of lines in a byte slice (SIMD-accelerated via memchr).
open_store
Open the object store under void_dir/objects.
safe_join
Safely join a relative path to a root directory, preventing path traversal.
sha256
Compute SHA-256 hash of data.
to_utf8
Convert a Path to a Utf8PathBuf, returning VoidError::InvalidPath on non-UTF-8.
validate_nix_store_path
Validate that a path is a legitimate Nix store path.