pub fn acquire(role: Role) -> Result<InstanceGuard, InstanceError>Expand description
Acquire the single-instance lock for role (a file under
paths::config_dir). Returns Ok(guard) on success — keep the guard
alive until the process is about to exit.
AlreadyRunning is the polite “another copy is open” signal callers
surface to the user (and exit with a non-error status). Other variants
indicate filesystem trouble.
§Errors
Returns InstanceError if the lock path can’t be resolved, the lock file
can’t be opened, another instance already holds the lock, or the lock
syscall itself fails.