pub struct WorkspaceLimits {
pub max_open: usize,
pub idle_timeout_ms: u64,
}Expand description
How many databases a workspace keeps open, and for how long.
Fields§
§max_open: usizeMost databases held open at once. The least recently used is closed to
make room. 0 is read as 1 — a pool that holds nothing would reopen
on every call.
idle_timeout_ms: u64How long a database may sit unused before Workspace::close_idle
closes it. 0 disables the sweep, so handles stay until evicted.
This is not a memory knob, it is a liveness knob: an open writer holds the file’s exclusive lock, so nothing else on the machine can touch that database until the handle goes. A long-running server that never let go would make its databases permanently unreachable from the CLI.
Implementations§
Source§impl WorkspaceLimits
impl WorkspaceLimits
Sourcepub fn ceiling(&self) -> usize
pub fn ceiling(&self) -> usize
The effective ceiling: at least one, never more than
MAX_OPEN_CEILING. Clamped here, in one place, because max_open can
arrive from a config file and neither end of the range is safe to trust.
Trait Implementations§
Source§impl Clone for WorkspaceLimits
impl Clone for WorkspaceLimits
Source§fn clone(&self) -> WorkspaceLimits
fn clone(&self) -> WorkspaceLimits
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for WorkspaceLimits
Source§impl Debug for WorkspaceLimits
impl Debug for WorkspaceLimits
Source§impl Default for WorkspaceLimits
impl Default for WorkspaceLimits
impl Eq for WorkspaceLimits
Source§impl PartialEq for WorkspaceLimits
impl PartialEq for WorkspaceLimits
impl StructuralPartialEq for WorkspaceLimits
Auto Trait Implementations§
impl Freeze for WorkspaceLimits
impl RefUnwindSafe for WorkspaceLimits
impl Send for WorkspaceLimits
impl Sync for WorkspaceLimits
impl Unpin for WorkspaceLimits
impl UnsafeUnpin for WorkspaceLimits
impl UnwindSafe for WorkspaceLimits
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.