From 0a8aa1b6367258e542333fa4d3bed5826079d043 Mon Sep 17 00:00:00 2001 From: Jordan Terrell Date: Wed, 13 Feb 2019 06:17:26 -0600 Subject: [PATCH] Adding set_readahead_size setter to ReadOptions... --- src/db.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/db.rs b/src/db.rs index b871d87..4aa43dc 100644 --- a/src/db.rs +++ b/src/db.rs @@ -1721,6 +1721,18 @@ impl ReadOptions { pub fn set_total_order_seek(&mut self, v: bool) { unsafe { ffi::rocksdb_readoptions_set_total_order_seek(self.inner, v as c_uchar) } } + + /// ``` + /// use rocksdb::{ReadOptions}; + /// + /// let mut opts = ReadOptions::default(); + /// opts.set_readahead_size(4_194_304); // 4mb + /// ``` + pub fn set_readahead_size(&mut self, v: usize) { + unsafe { + ffi::rocksdb_readoptions_set_readahead_size(self.inner, v as size_t); + } + } } impl Default for ReadOptions {