[][src]Crate rocks

Rust-Rocks

The RocksDB API in Rustic Style.

Examples

use rocks::rocksdb::*;

let opt = Options::default().map_db_options(|db_opt| db_opt.create_if_missing(true));
let db = DB::open(opt, "./data").unwrap();

assert!(db.put(WriteOptions::default_instance(), b"hello", b"world").is_ok());

match db.get(ReadOptions::default_instance(), b"hello") {
    Ok(ref value) => println!("hello: {:?}", value),
    Err(e) => eprintln!("error: {}", e),
}
let _ = db.delete(WriteOptions::default_instance(), b"hello").unwrap();

Re-exports

pub use error::Error;

Modules

advanced_options

Advanced Options

cache

A Cache is an interface that maps keys to values.

compaction_filter

CompactionFilter allows an application to modify/delete a key-value at the time of compaction.

compaction_job_stats

CompactionJobStats used by event listener callback.

comparator

A Comparator object provides a total order across slices that are used as keys in an sstable or a database.

convenience

Misc utility functions.

db

A DB is a persistent ordered map from keys to values.

db_dump_tool

Dump and un-dump tools for rocksdb

debug

Debug helper functions

env

An Env is an interface used by the rocksdb implementation to access operating system functionality like the filesystem etc.

error

A Status encapsulates the result of an operation.

filter_policy

A database can be configured with a custom FilterPolicy object. This object is responsible for creating a small filter from a set of keys. These filters are stored in rocksdb and are consulted automatically by rocksdb to decide whether or not to read some information from disk. In many cases, a filter can cut down the number of disk seeks form a handful to a single disk seek per DB::Get() call.

flush_block_policy

Determine when to flush a block.

iostats_context

A thread local context for gathering io-stats efficiently and transparently.

iterator

An iterator yields a sequence of key/value pairs from a source.

listener

EventListener class contains a set of call-back functions that will be called when specific RocksDB event happens such as flush.

merge_operator

The Merge Operator

metadata

The metadata that describes a column family, a level, or a SST file,

options

Common options for DB, CF, read/write/flush/compact...

perf_context

A thread local context for gathering performance counter efficiently and transparently.

perf_level

Config about how much perf stats to collect

persistent_cache

Persistent cache interface for caching IO pages on a persistent medium.

prelude

The RocksDB prelude entry.

rate_limiter

RateLimiter object can be shared among RocksDB instances to control write rate of flush and compaction.

rocksdb
slice

Slice data structure for interacting with rocksdb keys and values.

slice_transform

Class for specifying user-defined functions which perform a transformation on a slice.

snapshot

Abstract handle to particular state of a DB.

sst_file_manager

SstFileManager is used to track SST files in the DB and control there deletion rate.

sst_file_writer

SstFileWriter is used to create sst files that can be added to database later.

statistics

Analyze the performance of a DB

table

Table options.

table_properties

contains a bunch of read-only properties of its associated table.

thread_status

This file defines the structures for exposing run-time status of any rocksdb-related thread. Such run-time status can be obtained via GetThreadList() API.

transaction_log

WAL logs

types

Define all public custom types here.

universal_compaction

Universal style of compaction.

utilities
version
wal_filter

WALFilter allows an application to inspect write-ahead-log (WAL) records or modify their processing on recovery.

write_batch

WriteBatch holds a collection of updates to apply atomically to a DB.

write_buffer_manager

WriteBufferManager is for managing memory allocation for one or more MemTables.

Type Definitions

Result

The result type returned by RocksDB, wraps Status