pub struct OpenOptions {
pub lock_timeout_ms: u32,
}Expand description
Knobs for Database::open_with_options.
All fields default to the same values the convenience
Database::open / [Database::open_encrypted] / etc. constructors use,
so OpenOptions::default() round-trips the historical behavior exactly.
Fields§
§lock_timeout_ms: u32Maximum time, in milliseconds, to wait for the cross-process database
lock (_meta/.lock) before failing the open with MongrelError::Io.
0 (the default) preserves the historical fail-fast semantics: a
single try_lock_exclusive call, no retry, no sleep. SQLite-style
busy_timeout semantics kick in once this is non-zero — the open
sleeps with progressively wider backoff (1ms → 10ms → 50ms) until
either the lock is acquired or lock_timeout_ms elapses, at which
point the open returns the same Io(WouldBlock) error the fail-fast
path would.
Only the cross-process lock is affected. Mounted tables, page-cache misses, and WAL appends already serialize through in-process locks that handle their own contention.
Implementations§
Source§impl OpenOptions
impl OpenOptions
Sourcepub fn with_lock_timeout_ms(self, ms: u32) -> Self
pub fn with_lock_timeout_ms(self, ms: u32) -> Self
Set OpenOptions::lock_timeout_ms. 0 keeps the fail-fast default;
SQLite-style applications typically pick 1_000 – 5_000ms.
Trait Implementations§
Source§impl Clone for OpenOptions
impl Clone for OpenOptions
Source§fn clone(&self) -> OpenOptions
fn clone(&self) -> OpenOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OpenOptions
impl Debug for OpenOptions
Source§impl Default for OpenOptions
impl Default for OpenOptions
Source§fn default() -> OpenOptions
fn default() -> OpenOptions
Auto Trait Implementations§
impl Freeze for OpenOptions
impl RefUnwindSafe for OpenOptions
impl Send for OpenOptions
impl Sync for OpenOptions
impl Unpin for OpenOptions
impl UnsafeUnpin for OpenOptions
impl UnwindSafe for OpenOptions
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more