pub struct ReadOptions { /* private fields */ }

Implementations§

source§

impl ReadOptions

source

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

source

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.

source

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.

source

pub fn set_iterate_lower_bound<K: AsRef<[u8]>>(&mut self, key: K)

Sets the lower bound for an iterator.

source

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

source

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.

source

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
source

pub fn set_async_io(&mut self, v: bool)

Asynchronously prefetch some data.

Used for sequential reads and internal automatic prefetching.

Default: false

source

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

source§

fn clone(&self) -> ReadOptions

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for ReadOptions

source§

fn default() -> ReadOptions

Returns the “default value” for a type. Read more
source§

impl Drop for ReadOptions

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl GetCF<ReadOptions> for OptimisticTransaction

source§

fn get_cf_full<K: AsRef<[u8]>>( &self, cf: Option<&ColumnFamily>, key: K, readopts: Option<&ReadOptions> ) -> Result<Option<DBVector>, Error>

source§

fn get_cf<K: AsRef<[u8]>>( &self, cf: &ColumnFamily, key: K ) -> Result<Option<DBVector>, Error>

source§

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>

source§

fn get_cf_full<K: AsRef<[u8]>>( &self, cf: Option<&ColumnFamily>, key: K, readopts: Option<&ReadOptions> ) -> Result<Option<DBVector>, Error>

source§

fn get_cf<K: AsRef<[u8]>>( &self, cf: &ColumnFamily, key: K ) -> Result<Option<DBVector>, Error>

source§

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>

source§

fn get_cf_full<K: AsRef<[u8]>>( &self, cf: Option<&ColumnFamily>, key: K, readopts: Option<&ReadOptions> ) -> Result<Option<DBVector>, Error>

source§

fn get_cf<K: AsRef<[u8]>>( &self, cf: &ColumnFamily, key: K ) -> Result<Option<DBVector>, Error>

source§

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,

source§

fn get_cf_full<K: AsRef<[u8]>>( &self, cf: Option<&ColumnFamily>, key: K, readopts: Option<&ReadOptions> ) -> Result<Option<DBVector>, Error>

source§

fn get_cf<K: AsRef<[u8]>>( &self, cf: &ColumnFamily, key: K ) -> Result<Option<DBVector>, Error>

source§

fn get_cf_opt<K: AsRef<[u8]>>( &self, cf: &ColumnFamily, key: K, readopts: &R ) -> Result<Option<DBVector>, Error>

source§

impl GetCF<ReadOptions> for TransactionDB

source§

fn get_cf_full<K: AsRef<[u8]>>( &self, cf: Option<&ColumnFamily>, key: K, readopts: Option<&ReadOptions> ) -> Result<Option<DBVector>, Error>

source§

fn get_cf<K: AsRef<[u8]>>( &self, cf: &ColumnFamily, key: K ) -> Result<Option<DBVector>, Error>

source§

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>,

source§

fn get_cf_full<K: AsRef<[u8]>>( &self, cf: Option<&ColumnFamily>, key: K, readopts: Option<&ReadOptions> ) -> Result<Option<DBVector>, Error>

source§

fn get_cf<K: AsRef<[u8]>>( &self, cf: &ColumnFamily, key: K ) -> Result<Option<DBVector>, Error>

source§

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

source§

impl MultiGet<ReadOptions> for OptimisticTransaction

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>,

source§

fn multi_get<K, I>(&self, keys: I) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = K>,

source§

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>

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>,

source§

fn multi_get<K, I>(&self, keys: I) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = K>,

source§

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>

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>,

source§

fn multi_get<K, I>(&self, keys: I) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = K>,

source§

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,

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>,

source§

fn multi_get<K, I>(&self, keys: I) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = K>,

source§

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

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>,

source§

fn multi_get<K, I>(&self, keys: I) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = K>,

source§

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>,

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>,

source§

fn multi_get<K, I>(&self, keys: I) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = K>,

source§

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

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)>,

source§

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)>,

source§

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>

source§

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)>,

source§

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)>,

source§

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>

source§

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)>,

source§

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)>,

source§

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,

source§

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)>,

source§

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)>,

source§

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

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)>,

source§

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)>,

source§

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>,

source§

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)>,

source§

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)>,

source§

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 Send for ReadOptions

source§

impl Sync for ReadOptions

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> BatchedMultiGetCF<ReadOptions> for Twhere T: Handle<rocksdb_t> + Read,

source§

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>,

source§

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>,

source§

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> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> GetCF<ReadOptions> for Twhere T: Handle<rocksdb_t> + Read,

source§

fn get_cf_full<K>( &self, cf: Option<&ColumnFamily>, key: K, readopts: Option<&ReadOptions> ) -> Result<Option<DBVector>, Error>where K: AsRef<[u8]>,

source§

fn get_cf<K: AsRef<[u8]>>( &self, cf: &ColumnFamily, key: K ) -> Result<Option<DBVector>, Error>

source§

fn get_cf_opt<K: AsRef<[u8]>>( &self, cf: &ColumnFamily, key: K, readopts: &R ) -> Result<Option<DBVector>, Error>

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

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>,

Return the values associated with the given keys using read options.

source§

fn multi_get<K, I>(&self, keys: I) -> Vec<Result<Option<DBVector>, Error>>where K: AsRef<[u8]>, I: IntoIterator<Item = K>,

source§

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,

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)>,

Return the values associated with the given keys and column families using read options.

source§

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)>,

source§

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<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.