Struct cdb::CDB
[−]
[src]
pub struct CDB { // some fields omitted }
CDB file reader
Methods
impl CDB
fn new(f: File) -> Result<CDB>
Constructs a new CDB reader from an already opened file.
Examples
use std::fs; let file = fs::File::open("tests/test1.cdb").unwrap(); let cdb = cdb::CDB::new(file).unwrap();
fn open<P: AsRef<Path>>(filename: P) -> Result<CDB>
Constructs a new CDB by opening a file.
Examples
let cdb = cdb::CDB::open("tests/test1.cdb").unwrap();
fn find(&mut self, key: &[u8]) -> CDBIter
Find all records with the named key.
Examples
let mut cdb = cdb::CDB::open("tests/test1.cdb").unwrap(); for result in cdb.find(b"one") { println!("{:?}", result.unwrap()); }