pub struct GuardBuilder { /* private fields */ }guard only.Expand description
Options for Guard.
Implementations§
Source§impl GuardBuilder
impl GuardBuilder
Sourcepub fn lock_dir(self, dir: impl Into<PathBuf>) -> Self
pub fn lock_dir(self, dir: impl Into<PathBuf>) -> Self
The directory for the lock and pid files. The default depends only on
the user (see guard); a database should pass its data directory.
Created owner-only (0700) on Unix when missing; on Windows it inherits
its parent’s permissions, so choose a parent other users cannot write
to (not C:\ProgramData itself).
Sourcepub fn lock(self, on: bool) -> Self
pub fn lock(self, on: bool) -> Self
Whether to take the single-instance lock (default true). Pass false when a supervisor holds it, as tower does across hand-off restarts.
Sourcepub fn allow_network_lock(self, on: bool) -> Self
pub fn allow_network_lock(self, on: bool) -> Self
Accept a lock directory on a network filesystem (nfs, cifs, WSL’s
9p), whose locks may not hold across machines (default false).
Sourcepub fn umask(self, mask: u32) -> Self
pub fn umask(self, mask: u32) -> Self
The umask to set (default 0o027). Unix only; ignored on Windows.
Sourcepub fn keep_umask(self) -> Self
pub fn keep_umask(self) -> Self
Leave the umask as it is.
Sourcepub fn open_files_target(self, n: u64) -> Self
pub fn open_files_target(self, n: u64) -> Self
The soft open-file limit to raise to (default 65 536), capped at the
hard limit and, on macOS, at kern.maxfilesperproc.
Sourcepub fn open_files_minimum(self, n: u64) -> Self
pub fn open_files_minimum(self, n: u64) -> Self
The hard open-file limit below which the guard refuses to start (default 1 024).