update for rustc 1.0.0-nightly (1d00c545e 2015-01-30 19:56:34 +0000)

without.crypto
Dan Burkert 10 years ago
parent 27bfa93a0a
commit 37db788f1c
  1. 3
      Cargo.toml
  2. 4
      lmdb-sys/build.rs
  3. 3
      lmdb-sys/src/lib.rs
  4. 3
      src/cursor.rs
  5. 2
      src/database.rs
  6. 8
      src/environment.rs
  7. 9
      src/error.rs
  8. 6
      src/flags.rs
  9. 9
      src/lib.rs
  10. 6
      src/transaction.rs

@ -16,3 +16,6 @@ name = "lmdb"
[dependencies.lmdb-sys] [dependencies.lmdb-sys]
path = "lmdb-sys" path = "lmdb-sys"
[dependencies.bitflags]
version = "*"

@ -1,4 +1,4 @@
#![allow(unstable)] #![feature(collections, io, os, path)]
extern crate "pkg-config" as pkg_config; extern crate "pkg-config" as pkg_config;
extern crate bindgen; extern crate bindgen;
@ -6,7 +6,7 @@ extern crate gcc;
use bindgen::{Bindings, BindgenOptions, LinkType}; use bindgen::{Bindings, BindgenOptions, LinkType};
use std::default::Default; use std::default::Default;
use std::io::fs; use std::old_io::fs;
use std::os; use std::os;
fn main() { fn main() {

@ -4,10 +4,9 @@
non_camel_case_types, non_camel_case_types,
non_snake_case, non_snake_case,
raw_pointer_derive, raw_pointer_derive,
unstable,
)] )]
#![feature(plugin)] #![feature(libc, plugin)]
extern crate libc; extern crate libc;

@ -296,7 +296,8 @@ impl <'txn> Iterator for IterDup<'txn> {
#[cfg(test)] #[cfg(test)]
mod test { mod test {
use std::{io, ptr}; use std::old_io as io;
use std::ptr;
use test::{Bencher, black_box}; use test::{Bencher, black_box};
use ffi::*; use ffi::*;

@ -9,7 +9,7 @@ use error::{LmdbResult, lmdb_result};
/// A handle to an individual database in an environment. /// A handle to an individual database in an environment.
/// ///
/// A database handle denotes the name and parameters of a database in an environment. /// A database handle denotes the name and parameters of a database in an environment.
#[derive(Show, Clone, Copy, Eq, PartialEq)] #[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct Database { pub struct Database {
dbi: ffi::MDB_dbi, dbi: ffi::MDB_dbi,
} }

@ -1,6 +1,6 @@
use libc::{c_uint, size_t, mode_t}; use libc::{c_uint, size_t, mode_t};
use std::ffi::CString; use std::ffi::CString;
use std::io::FilePermission; use std::old_io::FilePermission;
use std::path::BytesContainer; use std::path::BytesContainer;
use std::ptr; use std::ptr;
use std::sync::Mutex; use std::sync::Mutex;
@ -150,7 +150,7 @@ impl Drop for Environment {
/////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////
/// Options for opening or creating an environment. /// Options for opening or creating an environment.
#[derive(Show, PartialEq, Eq, Copy, Clone)] #[derive(Debug, PartialEq, Eq, Copy, Clone)]
pub struct EnvironmentBuilder { pub struct EnvironmentBuilder {
flags: EnvironmentFlags, flags: EnvironmentFlags,
max_readers: Option<c_uint>, max_readers: Option<c_uint>,
@ -237,7 +237,7 @@ impl EnvironmentBuilder {
#[cfg(test)] #[cfg(test)]
mod test { mod test {
use std::io; use std::old_io as io;
use flags::*; use flags::*;
use super::*; use super::*;
@ -325,7 +325,7 @@ mod test {
let env = Environment::new().set_flags(READ_ONLY) let env = Environment::new().set_flags(READ_ONLY)
.open(dir.path(), io::USER_RWX) .open(dir.path(), io::USER_RWX)
.unwrap(); .unwrap();
assert!(env.sync(true).is_ok()); env.sync(true).unwrap();
} }
} }
} }

@ -2,11 +2,12 @@ use libc::c_int;
use std; use std;
use std::mem; use std::mem;
use std::error::Error; use std::error::Error;
use std::fmt;
use std::str; use std::str;
use ffi; use ffi;
#[derive(Show, Eq, PartialEq, Copy, Clone)] #[derive(Debug, Eq, PartialEq, Copy, Clone)]
pub enum LmdbError { pub enum LmdbError {
/// key/data pair already exists. /// key/data pair already exists.
KeyExist, KeyExist,
@ -106,6 +107,12 @@ impl LmdbError {
} }
} }
impl fmt::Display for LmdbError {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
write!(fmt, "{}", self.description())
}
}
impl Error for LmdbError { impl Error for LmdbError {
fn description(&self) -> &str { fn description(&self) -> &str {
unsafe { unsafe {

@ -4,7 +4,7 @@ use ffi::*;
bitflags! { bitflags! {
#[doc="Environment Options"] #[doc="Environment Options"]
#[derive(Show)] #[derive(Debug)]
flags EnvironmentFlags: c_uint { flags EnvironmentFlags: c_uint {
#[doc="Use a fixed address for the mmap region. This flag must be specified"] #[doc="Use a fixed address for the mmap region. This flag must be specified"]
@ -105,7 +105,7 @@ bitflags! {
bitflags! { bitflags! {
#[doc="Database Options"] #[doc="Database Options"]
#[derive(Show)] #[derive(Debug)]
flags DatabaseFlags: c_uint { flags DatabaseFlags: c_uint {
#[doc="Keys are strings to be compared in reverse order, from the end of the strings"] #[doc="Keys are strings to be compared in reverse order, from the end of the strings"]
@ -141,7 +141,7 @@ bitflags! {
bitflags! { bitflags! {
#[doc="Write Options"] #[doc="Write Options"]
#[derive(Show)] #[derive(Debug)]
flags WriteFlags: c_uint { flags WriteFlags: c_uint {
#[doc="Insert the new item only if the key does not already appear in the database."] #[doc="Insert the new item only if the key does not already appear in the database."]

@ -4,15 +4,16 @@
//! Provides the minimal amount of abstraction necessary to interact with LMDB safely in Rust. In //! 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/). //! general, the API is very similar to the LMDB [C-API](http://symas.com/mdb/doc/).
#![feature(unsafe_destructor, optin_builtin_traits)] #![feature(collections, core, hash, io, libc, optin_builtin_traits, path, std_misc, test, unsafe_destructor)]
#![allow(unstable)] #![cfg_attr(test, feature(rand))]
#[macro_use] extern crate log;
extern crate libc; extern crate libc;
extern crate "lmdb-sys" as ffi; extern crate "lmdb-sys" as ffi;
extern crate test; extern crate test;
extern crate collections; extern crate collections;
#[macro_use]
extern crate bitflags;
pub use cursor::{ pub use cursor::{
Cursor, Cursor,
@ -63,7 +64,7 @@ mod transaction;
#[cfg(test)] #[cfg(test)]
mod test_utils { mod test_utils {
use std::io; use std::old_io as io;
use super::*; use super::*;

@ -1,7 +1,7 @@
use libc::{c_uint, c_void, size_t}; use libc::{c_uint, c_void, size_t};
use std::{mem, ptr, raw}; use std::{mem, ptr, raw};
use std::marker; use std::marker;
use std::io::BufWriter; use std::old_io::BufWriter;
use ffi; use ffi;
@ -365,7 +365,7 @@ impl <'env> Transaction<'env> for RwTransaction<'env> {
#[cfg(test)] #[cfg(test)]
mod test { mod test {
use std::io; use std::old_io as io;
use std::ptr; use std::ptr;
use std::rand::{Rng, XorShiftRng}; use std::rand::{Rng, XorShiftRng};
use std::sync::{Arc, Barrier, Future}; use std::sync::{Arc, Barrier, Future};
@ -410,7 +410,7 @@ mod test {
let mut txn = env.begin_rw_txn().unwrap(); let mut txn = env.begin_rw_txn().unwrap();
{ {
let mut writer = txn.reserve(db, b"key1", 4, WriteFlags::empty()).unwrap(); let mut writer = txn.reserve(db, b"key1", 4, WriteFlags::empty()).unwrap();
writer.write(b"val1").unwrap(); writer.write_all(b"val1").unwrap();
} }
txn.commit().unwrap(); txn.commit().unwrap();

Loading…
Cancel
Save