pub struct ReadOptions { /* private fields */ }
Implementations§
Source§impl ReadOptions
impl ReadOptions
Sourcepub fn fill_cache(&mut self, v: bool)
pub fn fill_cache(&mut self, v: bool)
Specify whether the “data block”/“index block”/“filter block” read for this iteration should be cached in memory? Callers may wish to set this field to false for bulk scans.
Default: true
Sourcepub fn set_snapshot<T>(&mut self, snapshot: &T)where
T: ConstHandle<rocksdb_snapshot_t>,
pub fn set_snapshot<T>(&mut self, snapshot: &T)where
T: ConstHandle<rocksdb_snapshot_t>,
Sets the snapshot which should be used for the read. The snapshot must belong to the DB that is being read and must not have been released.
Sourcepub fn set_iterate_upper_bound<K>(&mut self, key: K)
pub fn set_iterate_upper_bound<K>(&mut self, key: K)
Sets the upper bound for an iterator. The upper bound itself is not included on the iteration result.
Sourcepub fn set_iterate_lower_bound<K>(&mut self, key: K)
pub fn set_iterate_lower_bound<K>(&mut self, key: K)
Sets the lower bound for an iterator.
Sourcepub fn set_prefix_same_as_start(&mut self, v: bool)
pub fn set_prefix_same_as_start(&mut self, v: bool)
Enforce that the iterator only iterates over the same prefix as the seek. This option is effective only for prefix seeks, i.e. prefix_extractor is non-null for the column family and total_order_seek is false. Unlike iterate_upper_bound, prefix_same_as_start only works within a prefix but in both directions.
Default: false
Sourcepub fn set_total_order_seek(&mut self, v: bool)
pub fn set_total_order_seek(&mut self, v: bool)
Enable a total order seek regardless of index format (e.g. hash index) used in the table. Some table format (e.g. plain table) may not support this option.
If true when calling Get(), we also skip prefix bloom when reading from block based table. It provides a way to read existing data after changing implementation of prefix extractor.
Sourcepub fn set_readahead_size(&mut self, v: usize)
pub fn set_readahead_size(&mut self, v: usize)
If non-zero, an iterator will create a new table reader which performs reads of the given size. Using a large size (> 2MB) can improve the performance of forward iteration on spinning disks. Default: 0
use ckb_rocksdb::{ReadOptions};
let mut opts = ReadOptions::default();
opts.set_readahead_size(4_194_304); // 4mb
Sourcepub fn set_async_io(&mut self, v: bool)
pub fn set_async_io(&mut self, v: bool)
Asynchronously prefetch some data.
Used for sequential reads and internal automatic prefetching.
Default: false
pub fn input_or_default( input: Option<&ReadOptions>, default_readopts: &mut Option<ReadOptions>, ) -> Result<*mut rocksdb_readoptions_t, Error>
Trait Implementations§
Source§impl<T> BatchedMultiGetCF<ReadOptions> for T
impl<T> BatchedMultiGetCF<ReadOptions> for T
fn batched_multi_get_cf_full<'a, K, I>( &self, cf: &ColumnFamily, keys: I, sorted_input: bool, readopts: Option<&ReadOptions>, ) -> Vec<Result<Option<DBPinnableSlice<'_>>, Error>>
fn batched_multi_get_cf<'a, K, I>( &self, cf: &ColumnFamily, keys: I, sorted_input: bool, ) -> Vec<Result<Option<DBPinnableSlice<'_>>, Error>>
fn batched_multi_get_cf_opt<'a, K, I>( &self, cf: &ColumnFamily, keys: I, sorted_input: bool, readopts: &R, ) -> Vec<Result<Option<DBPinnableSlice<'_>>, Error>>
Source§impl Clone for ReadOptions
impl Clone for ReadOptions
Source§fn clone(&self) -> ReadOptions
fn clone(&self) -> ReadOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Default for ReadOptions
impl Default for ReadOptions
Source§fn default() -> ReadOptions
fn default() -> ReadOptions
Source§impl Drop for ReadOptions
impl Drop for ReadOptions
Source§impl<T> GetCF<ReadOptions> for T
impl<T> GetCF<ReadOptions> for T
fn get_cf_full<K>( &self, cf: Option<&ColumnFamily>, key: K, readopts: Option<&ReadOptions>, ) -> Result<Option<DBVector>, Error>
fn get_cf<K>( &self, cf: &ColumnFamily, key: K, ) -> Result<Option<DBVector>, Error>
fn get_cf_opt<K>( &self, cf: &ColumnFamily, key: K, readopts: &R, ) -> Result<Option<DBVector>, Error>
Source§impl Handle<rocksdb_readoptions_t> for ReadOptions
impl Handle<rocksdb_readoptions_t> for ReadOptions
fn handle(&self) -> *mut rocksdb_readoptions_t
Source§impl<T> MultiGet<ReadOptions> for T
impl<T> MultiGet<ReadOptions> for T
Source§fn multi_get_full<K, I>(
&self,
keys: I,
readopts: Option<&ReadOptions>,
) -> Vec<Result<Option<DBVector>, Error>>
fn multi_get_full<K, I>( &self, keys: I, readopts: Option<&ReadOptions>, ) -> Vec<Result<Option<DBVector>, Error>>
Return the values associated with the given keys using read options.
fn multi_get<K, I>(&self, keys: I) -> Vec<Result<Option<DBVector>, Error>>
fn multi_get_opt<K, I>( &self, keys: I, readopts: &R, ) -> Vec<Result<Option<DBVector>, Error>>
Source§impl<T> MultiGetCF<ReadOptions> for T
impl<T> MultiGetCF<ReadOptions> for T
Source§fn multi_get_cf_full<'a, K, I>(
&self,
keys: I,
readopts: Option<&ReadOptions>,
) -> Vec<Result<Option<DBVector>, Error>>
fn multi_get_cf_full<'a, K, I>( &self, keys: I, readopts: Option<&ReadOptions>, ) -> Vec<Result<Option<DBVector>, Error>>
Return the values associated with the given keys and column families using read options.
fn multi_get_cf<'a, K, I>( &self, keys_cf: I, ) -> Vec<Result<Option<DBVector>, Error>>
fn multi_get_cf_opt<'a, K, I>( &self, keys_cf: I, readopts: &R, ) -> Vec<Result<Option<DBVector>, Error>>
impl Send for ReadOptions
impl Sync for ReadOptions
Auto Trait Implementations§
impl Freeze for ReadOptions
impl RefUnwindSafe for ReadOptions
impl Unpin for ReadOptions
impl UnwindSafe for ReadOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more