pub struct Config {
pub data_path: Option<PathBuf>,
pub hnsw_config: HnswConfig,
pub max_vectors: usize,
pub auto_persist: bool,
pub persist_interval_secs: u64,
}Expand description
Configuration for the vector database.
Fields§
§data_path: Option<PathBuf>Path to store data on disk. If None, data is kept in memory only.
hnsw_config: HnswConfigHNSW index configuration.
max_vectors: usizeMaximum number of vectors per collection (0 = unlimited).
auto_persist: boolEnable automatic persistence (periodic snapshots).
persist_interval_secs: u64Interval for automatic persistence in seconds.
Implementations§
Source§impl Config
impl Config
Sourcepub fn memory() -> Self
pub fn memory() -> Self
Create an in-memory configuration.
Data will not be persisted and will be lost when the process exits.
Sourcepub fn persistent<P: Into<PathBuf>>(path: P) -> Self
pub fn persistent<P: Into<PathBuf>>(path: P) -> Self
Create a persistent configuration.
Data will be stored at the specified path and loaded on startup.
Sourcepub fn with_hnsw_config(self, config: HnswConfig) -> Self
pub fn with_hnsw_config(self, config: HnswConfig) -> Self
Set the HNSW configuration.
Sourcepub fn with_max_vectors(self, max: usize) -> Self
pub fn with_max_vectors(self, max: usize) -> Self
Set the maximum number of vectors per collection.
Sourcepub fn with_auto_persist(self, enabled: bool) -> Self
pub fn with_auto_persist(self, enabled: bool) -> Self
Enable or disable automatic persistence.
Sourcepub fn with_persist_interval(self, secs: u64) -> Self
pub fn with_persist_interval(self, secs: u64) -> Self
Set the persistence interval in seconds.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more