pub fn with_lock<T, E, F>(f: F) -> Result<T, E>Expand description
Acquires an exclusive flock on the registry-cache lock file for the
duration of f. The lock file is created on first use. Released
when f returns (including via panic-unwind, since the underlying
file descriptor is closed by Drop).
Use this around every operation that touches refs, the PID file,
the config file, or the zot process state. Generic over the
caller’s error type E (which must be constructible from
LockError) so callers can propagate their own error variants
from f without a boxed catch-all.