Skip to main content

OpenOptions

Struct OpenOptions 

Source
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: Storage

Selects 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

Source

pub fn new() -> Self

Starts a builder with all defaults (writer/native, no timeout, no TTL cleanup, automatic inference budgets).

Source

pub fn models_dir(self, directory: impl AsRef<Path>) -> Self

Source

pub fn storage(self, storage: Storage) -> Self

Source

pub fn mode(self, mode: OpenMode) -> Self

Source

pub fn profile(self, profile: Profile) -> Self

Source

pub fn no_sync(self, no_sync: bool) -> Self

Source

pub fn remote_provider_configured(self, configured: bool) -> Self

Source

pub fn local_runtime_configured(self, configured: bool) -> Self

Source

pub fn generated_enrichment_replay(self, replay: bool) -> Self

Source

pub fn map_size(self, map_size: u64) -> Self

Source

pub fn ttl_cleanup(self, ttl_cleanup: TtlCleanupOptions) -> Self

Source

pub fn busy_timeout(self, timeout: Duration) -> Self

Source

pub fn host_budget_mb(self, mb: u32) -> Self

Source

pub fn backend_budget_mb(self, mb: u32) -> Self

Source

pub fn combined_budget_mb(self, mb: u32) -> Self

Source

pub fn kv_budget_mb(self, mb: u32) -> Self

Source

pub fn scratch_budget_mb(self, mb: u32) -> Self

Source

pub fn process_memory_budget_mb(self, mb: u32) -> Self

Source

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.

Trait Implementations§

Source§

impl Clone for OpenOptions

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for OpenOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for OpenOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for OpenOptions

Source§

impl PartialEq for OpenOptions

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for OpenOptions

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.