ckb_db

Struct ReadOptions

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

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>(&mut self, key: K)
where K: AsRef<[u8]>,

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>(&mut self, key: K)
where K: AsRef<[u8]>,

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<T> BatchedMultiGetCF<ReadOptions> for T
where 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 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<T> GetCF<ReadOptions> for T
where 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>( &self, cf: &ColumnFamily, key: K, ) -> Result<Option<DBVector>, Error>
where K: AsRef<[u8]>,

Source§

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

Source§

impl Handle<rocksdb_readoptions_t> for ReadOptions

Source§

impl<T> MultiGet<ReadOptions> for T
where 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 T
where 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 Send for ReadOptions

Source§

impl Sync for ReadOptions

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AsAny for T
where T: Any,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Cast to trait Any
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T