pub enum LockMode {
Enabled(LockOptions),
Skip,
}Expand description
Whether Database::open takes the writer lock at all, and on what terms when it does.
LockMode::Skip is the port of the TS open(dir, { lock: false }) and is dangerous by
design: a handle that skipped the lock writes the catalog it holds in memory over whatever
another writer declared meanwhile, because the lock is the only guard there. See
docs/format.md and the TS deklarowanie-indeksu-wspolbieznie.test.ts for the exact window.
Variants§
Enabled(LockOptions)
One writer per directory (ADR-hjxp/0006), on this lease tuning.
Skip
No lock at all — mutual exclusion between writers of this directory is not enforced.
Implementations§
Source§impl LockMode
impl LockMode
Sourcepub fn options(&self) -> Option<&LockOptions>
pub fn options(&self) -> Option<&LockOptions>
The lease tuning of an enabled lock — None when the caller asked to skip locking, which
leaves nothing to tune.
Sourcepub fn options_mut(&mut self) -> Option<&mut LockOptions>
pub fn options_mut(&mut self) -> Option<&mut LockOptions>
The mutable half of LockMode::options, for a host adjusting the defaults it opens with.