From f4d1e81e04ec6151431ccd4b86b181c6e85ed937 Mon Sep 17 00:00:00 2001 From: Lucjan Suski Date: Tue, 29 Oct 2019 16:33:40 +0100 Subject: [PATCH] Add example, fix type --- src/db_options.rs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/db_options.rs b/src/db_options.rs index 29d0131..0ed1ca9 100644 --- a/src/db_options.rs +++ b/src/db_options.rs @@ -414,12 +414,24 @@ impl Options { } } + /// Sets the optimize_filters_for_hits flag + /// + /// Default: `false` + /// + /// # Example + /// + /// ``` + /// use rocksdb::Options; + /// + /// let mut opts = Options::default(); + /// opts.set_optimize_filters_for_hits(true); + /// ``` pub fn set_optimize_filters_for_hits(&mut self, optimize_for_hits: bool) { unsafe { - ffi::rocksdb_options_set_optimize_filters_for_hits(self.inner, optimize_for_hits as c_uchar); + ffi::rocksdb_options_set_optimize_filters_for_hits(self.inner, optimize_for_hits as c_int); } } - + /// Sets the number of open files that can be used by the DB. You may need to /// increase this if your database has a large working set. Value `-1` means /// files opened are always kept open. You can estimate number of files based