pub struct Store {
pub cfg: Config,
/* private fields */
}
Expand description
A Store is used to keep data on disk using LMDB
Fields§
§cfg: Config
The config
field stores the initial configuration values for the given store
Implementations§
source§impl Store
impl Store
sourcepub fn new(config: Config) -> Result<Store, Error>
pub fn new(config: Config) -> Result<Store, Error>
Create a new store with the given configuration
sourcepub fn bucket<'a, K: Key, V: Value<'a>>(
&self,
name: Option<&str>
) -> Result<Bucket<'a, K, V>, Error>
pub fn bucket<'a, K: Key, V: Value<'a>>(
&self,
name: Option<&str>
) -> Result<Bucket<'a, K, V>, Error>
Get a named bucket
sourcepub fn int_bucket<'a, V: Value<'a>>(
&self,
name: Option<&str>
) -> Result<Bucket<'a, Integer, V>, Error>
pub fn int_bucket<'a, V: Value<'a>>(
&self,
name: Option<&str>
) -> Result<Bucket<'a, Integer, V>, Error>
Get a named bucket
sourcepub fn with_read_txn<'a, Res, F: FnOnce(&Txn<'a>) -> Result<Res, Error>>(
&'a self,
f: F
) -> Result<Res, Error>
pub fn with_read_txn<'a, Res, F: FnOnce(&Txn<'a>) -> Result<Res, Error>>(
&'a self,
f: F
) -> Result<Res, Error>
Create a readonly transaction and pass it to the provided function