pub struct SessionPoolMemoryPolicy { /* private fields */ }Expand description
Policy for refusing fresh imports in a same-process SessionPool.
Reusing an already-imported environment does not grow Lean’s process-global
import state. Fresh imports can, so this policy is checked only on cache
miss, immediately before Lean.importModules would run.
Implementations§
Source§impl SessionPoolMemoryPolicy
impl SessionPoolMemoryPolicy
Sourcepub fn disabled() -> Self
pub fn disabled() -> Self
Disable import/RSS refusals.
This preserves the historical SessionPool::with_capacity behavior
and is appropriate only for short-lived processes, tests with tiny
import counts, or explicit profiling workloads.
Sourcepub fn max_fresh_imports(self, limit: u64) -> Self
pub fn max_fresh_imports(self, limit: u64) -> Self
Refuse the next cache-miss import once limit fresh imports have
already run through this pool.
Sourcepub fn max_rss_kib(self, limit_kib: u64) -> Self
pub fn max_rss_kib(self, limit_kib: u64) -> Self
Refuse the next cache-miss import when current process RSS is at or
above limit_kib.
Sourcepub fn max_fresh_imports_limit(&self) -> Option<u64>
pub fn max_fresh_imports_limit(&self) -> Option<u64>
Return the configured fresh-import limit.
Sourcepub fn max_rss_kib_limit(&self) -> Option<u64>
pub fn max_rss_kib_limit(&self) -> Option<u64>
Return the configured process RSS ceiling in KiB.
Trait Implementations§
Source§impl Clone for SessionPoolMemoryPolicy
impl Clone for SessionPoolMemoryPolicy
Source§fn clone(&self) -> SessionPoolMemoryPolicy
fn clone(&self) -> SessionPoolMemoryPolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SessionPoolMemoryPolicy
impl Debug for SessionPoolMemoryPolicy
Source§impl Default for SessionPoolMemoryPolicy
impl Default for SessionPoolMemoryPolicy
Source§fn default() -> SessionPoolMemoryPolicy
fn default() -> SessionPoolMemoryPolicy
Returns the “default value” for a type. Read more
impl Eq for SessionPoolMemoryPolicy
Source§impl PartialEq for SessionPoolMemoryPolicy
impl PartialEq for SessionPoolMemoryPolicy
impl StructuralPartialEq for SessionPoolMemoryPolicy
Auto Trait Implementations§
impl Freeze for SessionPoolMemoryPolicy
impl RefUnwindSafe for SessionPoolMemoryPolicy
impl Send for SessionPoolMemoryPolicy
impl Sync for SessionPoolMemoryPolicy
impl Unpin for SessionPoolMemoryPolicy
impl UnsafeUnpin for SessionPoolMemoryPolicy
impl UnwindSafe for SessionPoolMemoryPolicy
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