Skip to main content

ConfigBuilder

Struct ConfigBuilder 

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

Memory limit in bytes (0 = use library default).

§num_threads: u32

Number of threads for query and optimize (0 = use library default).

§enable_console_log: bool

Whether 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

Source

pub fn new() -> Self

Creates a new builder with default values.

Source

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

Sets the memory limit in bytes.

Source

pub fn num_threads(self, count: u32) -> Self

Sets the number of threads for both query and optimize.

Source

pub fn enable_console_log(self, enable: bool) -> Self

Enables or disables console logging at Info level.

Source

pub fn fts_brute_force_by_keys_ratio(self, ratio: f32) -> Self

Sets the FTS brute-force-by-keys ratio.

Source

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.

Trait Implementations§

Source§

impl Default for ConfigBuilder

Source§

fn default() -> Self

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

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.