pub struct OpenOptions {Show 17 fields
pub storage: Storage,
pub mode: OpenMode,
pub profile: Profile,
pub no_sync: bool,
pub remote_provider_configured: bool,
pub local_runtime_configured: bool,
pub generated_enrichment_replay: bool,
pub map_size: u64,
pub ttl_cleanup: Option<TtlCleanupOptions>,
pub host_budget_mb: u32,
pub backend_budget_mb: u32,
pub combined_budget_mb: u32,
pub kv_budget_mb: u32,
pub scratch_budget_mb: u32,
pub process_memory_budget_mb: u32,
pub busy_timeout: Option<Duration>,
pub models_dir: Option<PathBuf>,
}Expand description
Configures crate::Database::open and crate::Database::create.
busy_timeout, like sqlite3_busy_timeout, retries Lite admission while
another process holds the writer lease or advances the allocator checkpoint.
Mutation bodies are never replayed by this admission retry.
None (or Some(Duration::ZERO)) fails immediately with
crate::Error::Busy. The C ABI takes whole milliseconds, so a
sub-millisecond duration is rounded up.
host_budget_mb, backend_budget_mb, combined_budget_mb,
kv_budget_mb, scratch_budget_mb, and process_memory_budget_mb are
explicit resource-budget overrides for the local embedded inference
runtime (0 means the embedded node’s own host-clamped default). They are
only consulted when local_runtime_configured is set.
Fields§
§storage: StorageSelects a .aflite file (the default) or a directory. Directory
storage is created by opening a missing path; crate::Database::create
only creates .aflite files.
mode: OpenMode§profile: Profile§no_sync: bool§remote_provider_configured: bool§local_runtime_configured: bool§generated_enrichment_replay: bool§map_size: u64§ttl_cleanup: Option<TtlCleanupOptions>§host_budget_mb: u32§backend_budget_mb: u32§combined_budget_mb: u32§kv_budget_mb: u32§scratch_budget_mb: u32§process_memory_budget_mb: u32§busy_timeout: Option<Duration>§models_dir: Option<PathBuf>Model directory for database enrichments; None uses the default.
Implementations§
Source§impl OpenOptions
impl OpenOptions
Sourcepub fn new() -> Self
pub fn new() -> Self
Starts a builder with all defaults (writer/native, no timeout, no TTL cleanup, automatic inference budgets).
pub fn models_dir(self, directory: impl AsRef<Path>) -> Self
pub fn storage(self, storage: Storage) -> Self
pub fn mode(self, mode: OpenMode) -> Self
pub fn profile(self, profile: Profile) -> Self
pub fn no_sync(self, no_sync: bool) -> Self
pub fn remote_provider_configured(self, configured: bool) -> Self
pub fn local_runtime_configured(self, configured: bool) -> Self
pub fn generated_enrichment_replay(self, replay: bool) -> Self
pub fn map_size(self, map_size: u64) -> Self
pub fn ttl_cleanup(self, ttl_cleanup: TtlCleanupOptions) -> Self
pub fn busy_timeout(self, timeout: Duration) -> Self
pub fn host_budget_mb(self, mb: u32) -> Self
pub fn backend_budget_mb(self, mb: u32) -> Self
pub fn combined_budget_mb(self, mb: u32) -> Self
pub fn kv_budget_mb(self, mb: u32) -> Self
pub fn scratch_budget_mb(self, mb: u32) -> Self
pub fn process_memory_budget_mb(self, mb: u32) -> Self
Sourcepub fn busy_timeout_ms(&self) -> u64
pub fn busy_timeout_ms(&self) -> u64
Rounds busy_timeout up to whole milliseconds, like the Go binding.
Returns 0 (fail immediately) when unset or zero. Exposed so callers
can see exactly what will be sent to the C ABI.