pub struct Config {
pub path: Option<String>,
pub persistence: PersistenceConfig,
}Expand description
Configuration for the storage engine
Fields§
§path: Option<String>Path to the database directory If empty, database operates in memory-only mode
persistence: PersistenceConfigConfiguration options for disk persistence Only used if path is Some
Implementations§
Source§impl Config
impl Config
Sourcepub fn with_path<P: Into<String>>(path: P) -> Self
pub fn with_path<P: Into<String>>(path: P) -> Self
Creates a new configuration with persistence at the given path
Sourcepub fn is_persistent(&self) -> bool
pub fn is_persistent(&self) -> bool
Returns true if persistence is enabled
Sourcepub fn with_persistence(self, config: PersistenceConfig) -> Self
pub fn with_persistence(self, config: PersistenceConfig) -> Self
Builder method to set persistence config
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 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> 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