Skip to main content

Settings

Struct Settings 

Source
pub struct Settings {
    pub database_path: Option<PathBuf>,
    pub config: Config,
    pub embedder: Option<Box<dyn Embedder>>,
    pub snapshot_every_ops: Option<u64>,
    pub snapshot_journal_bytes: Option<u64>,
    pub maintain_every_forgets: Option<u64>,
}
Expand description

Resolved runtime settings: the engine config, an optional embedder, and the maintenance policy. The wrapper-specific knobs (import batch size, server workers) are read separately from the same read_config table.

Fields§

§database_path: Option<PathBuf>

[database].path, if set. Wrapper-specific explicit paths take precedence over this value; otherwise the platform default is used.

§config: Config

The engine configuration (size-bearing fields from [engine]).

§embedder: Option<Box<dyn Embedder>>

The embedder built from [embedder], or None (lexical/graph/time recall still work without one).

§snapshot_every_ops: Option<u64>

[maintenance].snapshot_every_ops, if set.

§snapshot_journal_bytes: Option<u64>

[maintenance].snapshot_journal_bytes, if set.

§maintain_every_forgets: Option<u64>

[maintenance].maintain_every_forgets, if set.

Implementations§

Source§

impl Settings

Source

pub fn load(flag: Option<&Path>) -> Result<Settings, SettingsError>

Loads settings from the config file resolved by read_config (an explicit flag path, else $PLUGMEM_CONFIG, else the platform config path from crate::default_config_path). Missing config → defaults.

Source

pub fn from_table(table: Option<&Table>) -> Result<Settings, SettingsError>

Builds settings from an already-parsed config table (or None for all defaults). $PLUGMEM_EMBEDDER overrides [embedder].kind. Use this when the caller also needs its own keys from the same table (read once via read_config, then passed here).

Source

pub fn open(self, path: &Path) -> Result<Database, HostError>

Opens a read-write Database, applying the maintenance policy and embedder to the builder. Consumes self (the embedder moves into the database). For a read-only handle, take Settings::embedder out first, then call Database::open_readonly with Settings::config.

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> ErasedDestructor for T
where T: 'static,

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.