Mercurial > core / rust/lib/db/src/lib.rs
changeset 698: |
96958d3eb5b0 |
parent: |
f3d814fb136a
|
author: |
Richard Westhaver <ellis@rwest.io> |
date: |
Fri, 04 Oct 2024 22:04:59 -0400 |
permissions: |
-rw-r--r-- |
description: |
fixes |
3 //! This library provides types and builder functions for working with 4 //! databases. Currently the only backend supported is RocksDB. 5 #![feature(associated_type_defaults)] 7 #[cfg(feature = "rocksdb")] 9 use std::path::PathBuf; 12 pub use err::{Error, Result}; 18 #[cfg(feature = "rocksdb")] 19 type DB = rocksdb::DB; 20 #[cfg(not(feature = "rocksdb"))] 22 fn db_init(&self) -> Result<Self::DB>; 23 fn db_init_mut(&mut self) -> Result<()>; 24 fn db_open(&self) -> Result<()>; 25 fn db_close(&self) -> Result<()>; 26 fn db_close_mut(&mut self) -> Result<()>; 27 fn db_query(&self) -> Result<()>; 28 fn db_transaction(&self) -> Result<()>; 31 pub trait DbConfigExt: Configure { 32 fn db_path(self) -> Option<PathBuf>; 33 fn db_user(self) -> Option<String>; 34 fn set_db_config_value(&mut self, key: &str, val: &str) -> Option<String>; 35 fn get_db_config_value(self, key: &str) -> Option<String>;