Related enum type definitions to FFI.

master
Alexander Regueiro 8 years ago
parent 882aaffd52
commit 8cb22e5f1b
  1. 5
      librocksdb-sys/src/lib.rs
  2. 26
      src/rocksdb.rs

@ -958,6 +958,11 @@ pub const rocksdb_fifo_compaction: c_int = 2;
pub const rocksdb_similar_size_compaction_stop_style: c_int = 0; pub const rocksdb_similar_size_compaction_stop_style: c_int = 0;
pub const rocksdb_total_size_compaction_stop_style: c_int = 1; pub const rocksdb_total_size_compaction_stop_style: c_int = 1;
pub const rocksdb_recovery_mode_tolerate_corrupted_tail_records: c_int = 0;
pub const rocksdb_recovery_mode_absolute_consistency: c_int = 1;
pub const rocksdb_recovery_mode_point_in_time: c_int = 2;
pub const rocksdb_recovery_mode_skip_any_corrupted_record: c_int = 3;
pub enum rocksdb_t { } pub enum rocksdb_t { }
pub enum rocksdb_backup_engine_t { } pub enum rocksdb_backup_engine_t { }

@ -49,27 +49,27 @@ unsafe impl Sync for DB {}
#[derive(Debug, Copy, Clone, PartialEq)] #[derive(Debug, Copy, Clone, PartialEq)]
pub enum DBCompressionType { pub enum DBCompressionType {
None = 0, None = ffi::rocksdb_no_compression as isize,
Snappy = 1, Snappy = ffi::rocksdb_snappy_compression as isize,
Zlib = 2, Zlib = ffi::rocksdb_zlib_compression as isize,
Bz2 = 3, Bz2 = ffi::rocksdb_bz2_compression as isize,
Lz4 = 4, Lz4 = ffi::rocksdb_lz4_compression as isize,
Lz4hc = 5, Lz4hc = ffi::rocksdb_lz4hc_compression as isize,
} }
#[derive(Debug, Copy, Clone, PartialEq)] #[derive(Debug, Copy, Clone, PartialEq)]
pub enum DBCompactionStyle { pub enum DBCompactionStyle {
Level = 0, Level = ffi::rocksdb_level_compaction as isize,
Universal = 1, Universal = ffi::rocksdb_universal_compaction as isize,
Fifo = 2, Fifo = ffi::rocksdb_fifo_compaction as isize,
} }
#[derive(Debug, Copy, Clone, PartialEq)] #[derive(Debug, Copy, Clone, PartialEq)]
pub enum DBRecoveryMode { pub enum DBRecoveryMode {
TolerateCorruptedTailRecords = 0, TolerateCorruptedTailRecords = ffi::rocksdb_recovery_mode_tolerate_corrupted_tail_records as isize,
AbsoluteConsistency = 1, AbsoluteConsistency = ffi::rocksdb_recovery_mode_absolute_consistency as isize,
PointInTime = 2, PointInTime = ffi::rocksdb_recovery_mode_point_in_time as isize,
SkipAnyCorruptedRecords = 3, SkipAnyCorruptedRecord = ffi::rocksdb_recovery_mode_skip_any_corrupted_record as isize,
} }
/// An atomic batch of write operations. /// An atomic batch of write operations.

Loading…
Cancel
Save