Struct ckb_rocksdb::ReadOptions
source · 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: AsRef<[u8]>>(&mut self, key: K)
pub fn set_iterate_upper_bound<K: AsRef<[u8]>>(&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: AsRef<[u8]>>(&mut self, key: K)
pub fn set_iterate_lower_bound<K: AsRef<[u8]>>(&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 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 GetCF<ReadOptions> for OptimisticTransaction
impl GetCF<ReadOptions> for OptimisticTransaction
fn get_cf_full<K: AsRef<[u8]>>( &self, cf: Option<&ColumnFamily>, key: K, readopts: Option<&ReadOptions> ) -> Result<Option<DBVector>, Error>
fn get_cf<K: AsRef<[u8]>>( &self, cf: &ColumnFamily, key: K ) -> Result<Option<DBVector>, Error>
fn get_cf_opt<K: AsRef<[u8]>>( &self, cf: &ColumnFamily, key: K, readopts: &R ) -> Result<Option<DBVector>, Error>
source§impl<'a> GetCF<ReadOptions> for OptimisticTransactionSnapshot<'a>
impl<'a> GetCF<ReadOptions> for OptimisticTransactionSnapshot<'a>
fn get_cf_full<K: AsRef<[u8]>>( &self, cf: Option<&ColumnFamily>, key: K, readopts: Option<&ReadOptions> ) -> Result<Option<DBVector>, Error>
fn get_cf<K: AsRef<[u8]>>( &self, cf: &ColumnFamily, key: K ) -> Result<Option<DBVector>, Error>
fn get_cf_opt<K: AsRef<[u8]>>( &self, cf: &ColumnFamily, key: K, readopts: &R ) -> Result<Option<DBVector>, Error>
source§impl<'a> GetCF<ReadOptions> for Snapshot<'a>
impl<'a> GetCF<ReadOptions> for Snapshot<'a>
fn get_cf_full<K: AsRef<[u8]>>( &self, cf: Option<&ColumnFamily>, key: K, readopts: Option<&ReadOptions> ) -> Result<Option<DBVector>, Error>
fn get_cf<K: AsRef<[u8]>>( &self, cf: &ColumnFamily, key: K ) -> Result<Option<DBVector>, Error>
fn get_cf_opt<K: AsRef<[u8]>>( &self, cf: &ColumnFamily, key: K, readopts: &R ) -> Result<Option<DBVector>, Error>
source§impl<'a, T> GetCF<ReadOptions> for Transaction<'a, T>where
Transaction<'a, T>: Handle<rocksdb_transaction_t> + Read,
impl<'a, T> GetCF<ReadOptions> for Transaction<'a, T>where Transaction<'a, T>: Handle<rocksdb_transaction_t> + Read,
fn get_cf_full<K: AsRef<[u8]>>( &self, cf: Option<&ColumnFamily>, key: K, readopts: Option<&ReadOptions> ) -> Result<Option<DBVector>, Error>
fn get_cf<K: AsRef<[u8]>>( &self, cf: &ColumnFamily, key: K ) -> Result<Option<DBVector>, Error>
fn get_cf_opt<K: AsRef<[u8]>>( &self, cf: &ColumnFamily, key: K, readopts: &R ) -> Result<Option<DBVector>, Error>
source§impl GetCF<ReadOptions> for TransactionDB
impl GetCF<ReadOptions> for TransactionDB
fn get_cf_full<K: AsRef<[u8]>>( &self, cf: Option<&ColumnFamily>, key: K, readopts: Option<&ReadOptions> ) -> Result<Option<DBVector>, Error>
fn get_cf<K: AsRef<[u8]>>( &self, cf: &ColumnFamily, key: K ) -> Result<Option<DBVector>, Error>
fn get_cf_opt<K: AsRef<[u8]>>( &self, cf: &ColumnFamily, key: K, readopts: &R ) -> Result<Option<DBVector>, Error>
source§impl<'a, T> GetCF<ReadOptions> for TransactionSnapshot<'a, T>where
Transaction<'a, T>: GetCF<ReadOptions>,
impl<'a, T> GetCF<ReadOptions> for TransactionSnapshot<'a, T>where Transaction<'a, T>: GetCF<ReadOptions>,
fn get_cf_full<K: AsRef<[u8]>>( &self, cf: Option<&ColumnFamily>, key: K, readopts: Option<&ReadOptions> ) -> Result<Option<DBVector>, Error>
fn get_cf<K: AsRef<[u8]>>( &self, cf: &ColumnFamily, key: K ) -> Result<Option<DBVector>, Error>
fn get_cf_opt<K: AsRef<[u8]>>( &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 MultiGet<ReadOptions> for OptimisticTransaction
impl MultiGet<ReadOptions> for OptimisticTransaction
fn multi_get_full<K, I>( &self, keys: I, readopts: Option<&ReadOptions> ) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = K>,
fn multi_get<K, I>(&self, keys: I) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = K>,
fn multi_get_opt<K, I>( &self, keys: I, readopts: &R ) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = K>,
source§impl<'a> MultiGet<ReadOptions> for OptimisticTransactionSnapshot<'a>
impl<'a> MultiGet<ReadOptions> for OptimisticTransactionSnapshot<'a>
fn multi_get_full<K, I>( &self, keys: I, readopts: Option<&ReadOptions> ) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = K>,
fn multi_get<K, I>(&self, keys: I) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = K>,
fn multi_get_opt<K, I>( &self, keys: I, readopts: &R ) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = K>,
source§impl<'a> MultiGet<ReadOptions> for Snapshot<'a>
impl<'a> MultiGet<ReadOptions> for Snapshot<'a>
fn multi_get_full<K, I>( &self, keys: I, readopts: Option<&ReadOptions> ) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = K>,
fn multi_get<K, I>(&self, keys: I) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = K>,
fn multi_get_opt<K, I>( &self, keys: I, readopts: &R ) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = K>,
source§impl<'a, T> MultiGet<ReadOptions> for Transaction<'a, T>where
Transaction<'a, T>: Handle<rocksdb_transaction_t> + Read,
impl<'a, T> MultiGet<ReadOptions> for Transaction<'a, T>where Transaction<'a, T>: Handle<rocksdb_transaction_t> + Read,
fn multi_get_full<K, I>( &self, keys: I, readopts: Option<&ReadOptions> ) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = K>,
fn multi_get<K, I>(&self, keys: I) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = K>,
fn multi_get_opt<K, I>( &self, keys: I, readopts: &R ) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = K>,
source§impl MultiGet<ReadOptions> for TransactionDB
impl MultiGet<ReadOptions> for TransactionDB
fn multi_get_full<K, I>( &self, keys: I, readopts: Option<&ReadOptions> ) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = K>,
fn multi_get<K, I>(&self, keys: I) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = K>,
fn multi_get_opt<K, I>( &self, keys: I, readopts: &R ) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = K>,
source§impl<'a, T> MultiGet<ReadOptions> for TransactionSnapshot<'a, T>where
Transaction<'a, T>: MultiGet<ReadOptions>,
impl<'a, T> MultiGet<ReadOptions> for TransactionSnapshot<'a, T>where Transaction<'a, T>: MultiGet<ReadOptions>,
fn multi_get_full<K, I>( &self, keys: I, readopts: Option<&ReadOptions> ) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = K>,
fn multi_get<K, I>(&self, keys: I) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = K>,
fn multi_get_opt<K, I>( &self, keys: I, readopts: &R ) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = K>,
source§impl MultiGetCF<ReadOptions> for OptimisticTransaction
impl MultiGetCF<ReadOptions> for OptimisticTransaction
fn multi_get_cf_full<'a, K, I>( &self, keys: I, readopts: Option<&ReadOptions> ) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = (&'a ColumnFamily, K)>,
fn multi_get_cf<'a, K, I>( &self, keys_cf: I ) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = (&'a ColumnFamily, K)>,
fn multi_get_cf_opt<'a, K, I>( &self, keys_cf: I, readopts: &R ) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = (&'a ColumnFamily, K)>,
source§impl<'a> MultiGetCF<ReadOptions> for OptimisticTransactionSnapshot<'a>
impl<'a> MultiGetCF<ReadOptions> for OptimisticTransactionSnapshot<'a>
fn multi_get_cf_full<'m, K, I>( &self, keys: I, readopts: Option<&ReadOptions> ) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = (&'m ColumnFamily, K)>,
fn multi_get_cf<'a, K, I>( &self, keys_cf: I ) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = (&'a ColumnFamily, K)>,
fn multi_get_cf_opt<'a, K, I>( &self, keys_cf: I, readopts: &R ) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = (&'a ColumnFamily, K)>,
source§impl<'a> MultiGetCF<ReadOptions> for Snapshot<'a>
impl<'a> MultiGetCF<ReadOptions> for Snapshot<'a>
fn multi_get_cf_full<'m, K, I>( &self, keys: I, readopts: Option<&ReadOptions> ) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = (&'m ColumnFamily, K)>,
fn multi_get_cf<'a, K, I>( &self, keys_cf: I ) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = (&'a ColumnFamily, K)>,
fn multi_get_cf_opt<'a, K, I>( &self, keys_cf: I, readopts: &R ) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = (&'a ColumnFamily, K)>,
source§impl<'a, T> MultiGetCF<ReadOptions> for Transaction<'a, T>where
Transaction<'a, T>: Handle<rocksdb_transaction_t> + Read,
impl<'a, T> MultiGetCF<ReadOptions> for Transaction<'a, T>where Transaction<'a, T>: Handle<rocksdb_transaction_t> + Read,
fn multi_get_cf_full<'m, K, I>( &self, keys: I, readopts: Option<&ReadOptions> ) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = (&'m ColumnFamily, K)>,
fn multi_get_cf<'a, K, I>( &self, keys_cf: I ) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = (&'a ColumnFamily, K)>,
fn multi_get_cf_opt<'a, K, I>( &self, keys_cf: I, readopts: &R ) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = (&'a ColumnFamily, K)>,
source§impl MultiGetCF<ReadOptions> for TransactionDB
impl MultiGetCF<ReadOptions> for TransactionDB
fn multi_get_cf_full<'a, K, I>( &self, keys: I, readopts: Option<&ReadOptions> ) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = (&'a ColumnFamily, K)>,
fn multi_get_cf<'a, K, I>( &self, keys_cf: I ) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = (&'a ColumnFamily, K)>,
fn multi_get_cf_opt<'a, K, I>( &self, keys_cf: I, readopts: &R ) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = (&'a ColumnFamily, K)>,
source§impl<'a, T> MultiGetCF<ReadOptions> for TransactionSnapshot<'a, T>where
Transaction<'a, T>: MultiGet<ReadOptions>,
impl<'a, T> MultiGetCF<ReadOptions> for TransactionSnapshot<'a, T>where Transaction<'a, T>: MultiGet<ReadOptions>,
fn multi_get_cf_full<'m, K, I>( &self, keys: I, readopts: Option<&ReadOptions> ) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = (&'m ColumnFamily, K)>,
fn multi_get_cf<'a, K, I>( &self, keys_cf: I ) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = (&'a ColumnFamily, K)>,
fn multi_get_cf_opt<'a, K, I>( &self, keys_cf: I, readopts: &R ) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = (&'a ColumnFamily, K)>,
impl Send for ReadOptions
impl Sync for ReadOptions
Auto Trait Implementations§
Blanket Implementations§
source§impl<T> BatchedMultiGetCF<ReadOptions> for Twhere
T: Handle<rocksdb_t> + Read,
impl<T> BatchedMultiGetCF<ReadOptions> for Twhere T: Handle<rocksdb_t> + Read,
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>>where K: AsRef<[u8]> + 'a + ?Sized, I: IntoIterator<Item = &'a K>,
fn batched_multi_get_cf<'a, K, I>( &self, cf: &ColumnFamily, keys: I, sorted_input: bool ) -> Vec<Result<Option<DBPinnableSlice<'_>>, Error>>where K: AsRef<[u8]> + 'a + ?Sized, I: IntoIterator<Item = &'a K>,
fn batched_multi_get_cf_opt<'a, K, I>( &self, cf: &ColumnFamily, keys: I, sorted_input: bool, readopts: &R ) -> Vec<Result<Option<DBPinnableSlice<'_>>, Error>>where K: AsRef<[u8]> + 'a + ?Sized, I: IntoIterator<Item = &'a K>,
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> GetCF<ReadOptions> for Twhere
T: Handle<rocksdb_t> + Read,
impl<T> GetCF<ReadOptions> for Twhere T: Handle<rocksdb_t> + Read,
fn get_cf_full<K>( &self, cf: Option<&ColumnFamily>, key: K, readopts: Option<&ReadOptions> ) -> Result<Option<DBVector>, Error>where K: AsRef<[u8]>,
fn get_cf<K: AsRef<[u8]>>( &self, cf: &ColumnFamily, key: K ) -> Result<Option<DBVector>, Error>
fn get_cf_opt<K: AsRef<[u8]>>( &self, cf: &ColumnFamily, key: K, readopts: &R ) -> Result<Option<DBVector>, Error>
source§impl<T> MultiGet<ReadOptions> for Twhere
T: Handle<rocksdb_t> + Read,
impl<T> MultiGet<ReadOptions> for Twhere T: Handle<rocksdb_t> + Read,
source§fn multi_get_full<K, I>(
&self,
keys: I,
readopts: Option<&ReadOptions>
) -> Vec<Result<Option<DBVector>, Error>>where
K: AsRef<[u8]>,
I: IntoIterator<Item = K>,
fn multi_get_full<K, I>( &self, keys: I, readopts: Option<&ReadOptions> ) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = K>,
Return the values associated with the given keys using read options.
fn multi_get<K, I>(&self, keys: I) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = K>,
fn multi_get_opt<K, I>( &self, keys: I, readopts: &R ) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = K>,
source§impl<T> MultiGetCF<ReadOptions> for Twhere
T: Handle<rocksdb_t> + Read,
impl<T> MultiGetCF<ReadOptions> for Twhere T: Handle<rocksdb_t> + Read,
source§fn multi_get_cf_full<'a, K, I>(
&self,
keys: I,
readopts: Option<&ReadOptions>
) -> Vec<Result<Option<DBVector>, Error>>where
K: AsRef<[u8]>,
I: IntoIterator<Item = (&'a ColumnFamily, K)>,
fn multi_get_cf_full<'a, K, I>( &self, keys: I, readopts: Option<&ReadOptions> ) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = (&'a ColumnFamily, K)>,
Return the values associated with the given keys and column families using read options.