pub struct ConfigBuilder {
pub memory_limit: u64,
pub num_threads: u32,
pub enable_console_log: bool,
pub fts_brute_force_by_keys_ratio: Option<f32>,
}Expand description
Configuration builder for initializing the zvec library.
This struct collects configuration values without touching the C library, making it safe to use even before the library is initialized.
§Example
use zvec_rust::ConfigBuilder;
let config = ConfigBuilder::new()
.memory_limit(1024 * 1024 * 1024)
.num_threads(4)
.enable_console_log(true)
.build();Fields§
§memory_limit: u64Memory limit in bytes (0 = use library default).
num_threads: u32Number of threads for query and optimize (0 = use library default).
enable_console_log: boolWhether to enable console logging at Info level.
fts_brute_force_by_keys_ratio: Option<f32>FTS brute-force-by-keys ratio (None = use library default).
Implementations§
Source§impl ConfigBuilder
impl ConfigBuilder
Sourcepub fn memory_limit(self, bytes: u64) -> Self
pub fn memory_limit(self, bytes: u64) -> Self
Sets the memory limit in bytes.
Sourcepub fn num_threads(self, count: u32) -> Self
pub fn num_threads(self, count: u32) -> Self
Sets the number of threads for both query and optimize.
Sourcepub fn enable_console_log(self, enable: bool) -> Self
pub fn enable_console_log(self, enable: bool) -> Self
Enables or disables console logging at Info level.
Sourcepub fn fts_brute_force_by_keys_ratio(self, ratio: f32) -> Self
pub fn fts_brute_force_by_keys_ratio(self, ratio: f32) -> Self
Sets the FTS brute-force-by-keys ratio.
Sourcepub fn build(self) -> Self
pub fn build(self) -> Self
Finalizes the builder configuration.
This is a no-op that returns self for API consistency. The builder
is a plain-data struct — no C resources are allocated here.
To apply the configuration, pass the result to initialize.