Safe Rust bindings for LMDB with encryption at rest
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lmdb-rs/src/lib.rs

45 lines
1.3 KiB

10 years ago
//! Safe Rust bindings for the [Symas Lightning Memory-Mapped Database(LMDB)]
//! (http://symas.com/mdb/).
//!
//! Provides the minimal amount of abstraction necessary to interact with LMDB safely in Rust. In
//! general, the API is very similar to the LMDB [C-API](http://symas.com/mdb/doc/).
#![feature(phase, globs, macro_rules, unsafe_destructor)]
10 years ago
#[phase(plugin, link)] extern crate log;
extern crate libc;
10 years ago
extern crate "lmdb-sys" as ffi;
10 years ago
pub use cursor::Cursor;
pub use database::Database;
10 years ago
pub use environment::{Environment, EnvironmentBuilder};
pub use error::{LmdbResult, LmdbError};
pub use transaction::{ReadTransaction, WriteTransaction, RoTransaction, RwTransaction};
10 years ago
macro_rules! lmdb_try {
($expr:expr) => ({
match $expr {
::ffi::MDB_SUCCESS => (),
err_code => return Err(::std::error::FromError::from_error(::LmdbError::from_err_code(err_code))),
10 years ago
}
})
}
macro_rules! lmdb_try_with_cleanup {
($expr:expr, $cleanup:expr) => ({
match $expr {
::ffi::MDB_SUCCESS => (),
10 years ago
err_code => {
let _ = $cleanup;
return Err(::std::error::FromError::from_error(::LmdbError::from_err_code(err_code)))
10 years ago
},
}
})
}
mod cursor;
mod database;
10 years ago
mod environment;
mod error;
mod transaction;