#[non_exhaustive]pub struct ReadOptions {
pub verify_checksums: bool,
pub fill_cache: bool,
pub lower_bound: Option<Vec<u8>>,
pub upper_bound: Option<Vec<u8>>,
}Expand description
How one read or iterator behaves.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.verify_checksums: boolVerify the checksum of every block read from a table (default true).
Turning it off trades corruption detection for a little CPU; a corrupt block then decodes
to an error or to wrong data instead of a crate::ErrorCategory::Corruption error.
fill_cache: boolKeep the blocks this read loads in the block cache (default true).
A one-off scan sets it to false so it does not evict the working set.
lower_bound: Option<Vec<u8>>The least key an iterator shows (inclusive); None for no bound. Ignored by point reads
and scans, which take their range as arguments.
upper_bound: Option<Vec<u8>>The key an iterator stops before (exclusive); None for no bound. Ignored by point
reads and scans.
Implementations§
Source§impl ReadOptions
impl ReadOptions
Sourcepub fn with_prefix(self, prefix: &[u8]) -> Self
pub fn with_prefix(self, prefix: &[u8]) -> Self
Bounds an iterator to the keys that start with prefix.
use tessarikv::ReadOptions;
let options = ReadOptions::default().with_prefix(b"user/");
assert_eq!(options.lower_bound.as_deref(), Some(&b"user/"[..]));
assert_eq!(options.upper_bound.as_deref(), Some(&b"user0"[..]));Trait Implementations§
Source§impl Clone for ReadOptions
impl Clone for ReadOptions
Source§impl Debug for ReadOptions
impl Debug for ReadOptions
Source§impl Default for ReadOptions
impl Default for ReadOptions
impl Eq for ReadOptions
Source§impl PartialEq for ReadOptions
impl PartialEq for ReadOptions
impl StructuralPartialEq for ReadOptions
Auto Trait Implementations§
impl Freeze for ReadOptions
impl RefUnwindSafe for ReadOptions
impl Send for ReadOptions
impl Sync for ReadOptions
impl Unpin for ReadOptions
impl UnsafeUnpin 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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.