pub struct ConfigBuilder { /* private fields */ }
Expand description
Builder for Config
.
Implementations§
Source§impl ConfigBuilder
impl ConfigBuilder
Sourcepub const fn new(db_directory: Cow<'static, Path>) -> Self
pub const fn new(db_directory: Cow<'static, Path>) -> Self
Create a new ConfigBuilder
.
ConfigBuilder::build
can be called immediately
after this function to use default values.
Sourcepub fn build(self) -> Config
pub fn build(self) -> Config
Build into a Config
.
§Default values
READER_THREADS_DEFAULT
is used forConfig::reader_threads
Default::default
is used for all other values (except thedb_directory
)
Sourcepub fn db_directory(self, db_directory: Cow<'static, Path>) -> Self
pub fn db_directory(self, db_directory: Cow<'static, Path>) -> Self
Set a custom database directory (and file) Path
.
Sourcepub fn fast(self) -> Self
pub fn fast(self) -> Self
Tune the ConfigBuilder
for the highest performing,
but also most resource-intensive & maybe risky settings.
Good default for testing, and resource-available machines.
Sourcepub fn low_power(self) -> Self
pub fn low_power(self) -> Self
Tune the ConfigBuilder
for the lowest performing,
but also least resource-intensive settings.
Good default for resource-limited machines, e.g. a cheap VPS.
Sourcepub const fn reader_threads(self, reader_threads: NonZeroUsize) -> Self
pub const fn reader_threads(self, reader_threads: NonZeroUsize) -> Self
Set a custom Config::reader_threads
.
Sourcepub const fn resize_algorithm(self, resize_algorithm: ResizeAlgorithm) -> Self
pub const fn resize_algorithm(self, resize_algorithm: ResizeAlgorithm) -> Self
Set a custom ResizeAlgorithm
.
Trait Implementations§
Source§impl Clone for ConfigBuilder
impl Clone for ConfigBuilder
Source§fn clone(&self) -> ConfigBuilder
fn clone(&self) -> ConfigBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ConfigBuilder
impl Debug for ConfigBuilder
Source§impl<'de> Deserialize<'de> for ConfigBuilder
impl<'de> Deserialize<'de> for ConfigBuilder
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for ConfigBuilder
impl PartialEq for ConfigBuilder
Source§impl PartialOrd for ConfigBuilder
impl PartialOrd for ConfigBuilder
Source§impl Serialize for ConfigBuilder
impl Serialize for ConfigBuilder
impl StructuralPartialEq for ConfigBuilder
Auto Trait Implementations§
impl Freeze for ConfigBuilder
impl RefUnwindSafe for ConfigBuilder
impl Send for ConfigBuilder
impl Sync for ConfigBuilder
impl Unpin for ConfigBuilder
impl UnwindSafe for ConfigBuilder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 64 bytes