pub struct Guard { /* private fields */ }Available on crate feature
guard only.Expand description
The running guard. Dropping it closes the lock file, which releases the lock; the lock file itself is never deleted (deleting it would let two copies run, see the plan’s guard section).
Implementations§
Source§impl Guard
impl Guard
Sourcepub fn builder(name: &str) -> GuardBuilder
pub fn builder(name: &str) -> GuardBuilder
A builder for options other than the defaults.
use sys_lib::process::Guard;
// A database locks beside its data, so two copies under different users
// or run directories still exclude each other.
let guard = Guard::builder("hive")
.lock_dir("/var/lib/hive")
.open_files_target(1_048_576)
.open_files_minimum(65_536)
.build()?;Sourcepub fn report(&self) -> &GuardReport
pub fn report(&self) -> &GuardReport
What the guard did.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Guard
impl RefUnwindSafe for Guard
impl Send for Guard
impl Sync for Guard
impl Unpin for Guard
impl UnsafeUnpin for Guard
impl UnwindSafe for Guard
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more