pub struct Options {
pub path: PathBuf,
pub columns: Vec<ColumnOptions>,
pub sync_wal: bool,
pub sync_data: bool,
pub stats: bool,
pub salt: Option<[u8; 32]>,
pub compression_threshold: HashMap<ColId, u32>,
}
Expand description
Database configuration.
Fields§
§path: PathBuf
Database path.
columns: Vec<ColumnOptions>
Column settings
sync_wal: bool
fsync WAL to disk before committing any changes. Provides extra consistency guarantees. On by default.
sync_data: bool
fsync/msync data to disk before removing logs. Provides crash resistance guarantee. On by default.
stats: bool
Collect database statistics. May have effect on performance.
salt: Option<[u8; 32]>
Override salt value. If None
is specified salt is loaded from metadata
or randomly generated when creating a new database.
compression_threshold: HashMap<ColId, u32>
Minimal value size threshold to attempt compressing a value per column.
Optional. A sensible default is used if nothing is set for a given column.
Implementations§
source§impl Options
impl Options
pub fn with_columns(path: &Path, num_columns: u8) -> Options
pub fn write_metadata(&self, path: &Path, salt: &[u8; 32]) -> Result<()>
pub fn write_metadata_file(&self, path: &Path, salt: &[u8; 32]) -> Result<()>
pub fn write_metadata_with_version( &self, path: &Path, salt: &[u8; 32], version: Option<u32> ) -> Result<()>
pub fn write_metadata_file_with_version( &self, path: &Path, salt: &[u8; 32], version: Option<u32> ) -> Result<()>
pub fn load_and_validate_metadata(&self, create: bool) -> Result<Metadata>
pub fn load_metadata(path: &Path) -> Result<Option<Metadata>>
pub fn load_metadata_file(path: &Path) -> Result<Option<Metadata>>
pub fn is_valid(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Options
impl Send for Options
impl Sync for Options
impl Unpin for Options
impl UnwindSafe for Options
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