Skip to main content

DatabaseBuilder

Struct DatabaseBuilder 

Source
pub struct DatabaseBuilder { /* private fields */ }
Expand description

Tuning knobs of a Database. Construct through Database::builder.

Implementations§

Source§

impl DatabaseBuilder

Source

pub fn fsync(self, policy: FsyncPolicy) -> Self

Journal fsync policy (default: every operation).

Source

pub fn snapshot_every_ops(self, ops: u64) -> Self

Auto-snapshot after this many mutations (default 1024; 0 disables the count trigger).

Source

pub fn snapshot_journal_bytes(self, bytes: u64) -> Self

Auto-snapshot when the journal outgrows this many bytes (default 4 MiB; 0 disables the size trigger).

Source

pub fn maintain_every_forgets(self, forgets: u64) -> Self

Optional auto-maintain after this many forgets (default off — maintenance is O(database) and the first pass beyond the HNSW threshold pays the graph build).

Source

pub fn embedder(self, embedder: Box<dyn Embedder>) -> Self

The embedding provider. When set (and its dim() > 0), remember without a vector embeds the fact text and recall with a text but no vector embeds the query — both outside the database lock. Config::dim must equal the embedder’s dimension.

Source

pub fn open( self, path: impl Into<PathBuf>, ) -> Result<(Database, OpenReport), HostError>

Opens (or creates) the database at path.

§Errors

HostError::Locked when the file is owned elsewhere; HostError::Engine for config/snapshot/journal problems (including an embedder dimension that disagrees with Config::dim); HostError::Io for filesystem failures.

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> 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.