1#![deny(missing_docs)]
2use anyhow::Result;
14use std::path::Path;
15
16mod helpers;
17mod macros;
18pub mod ops;
20mod structs;
21mod threads;
22pub mod traits;
24pub mod wrappers;
26
27pub use {
28 ops::Operate,
29 structs::{material::Material, single::Single},
30 traits::{
31 auto_inc::AutoInc, change::Change, load::Load, store::Store, view::View, watch::Watch,
32 },
33 threads::wait_all,
34 wrappers::{batch::Batch, tree::Tree},
35};
36
37pub use database::Db;
38pub use sled::Config;
39use wrappers::*;
40
41pub fn open(path: impl AsRef<Path>) -> Result<Db> {
43 let db = sled::open(path)?;
44 Ok(Db::from(db))
45}
46
47pub fn open_temp() -> Result<Db> {
49 let db = sled::Config::new().temporary(true).open()?;
50 Ok(Db::from(db))
51}
52
53#[cfg(test)]
54mod tests;