Struct async_mwmr::KeysOptions
source · pub struct KeysOptions {
pub prefetch_size: usize,
pub reverse: bool,
pub all_versions: bool,
pub since_version: u64,
}
Expand description
Used to set options when iterating over key-value stores.
Fields§
§prefetch_size: usize
The number of KV pairs to prefetch while iterating.
Some databases optimize iteration by prefetching
reverse: bool
Direction of iteration. False is forward, true is backward.
all_versions: bool
Fetch all valid versions of the same key.
since_version: u64
Only read data that has version > since_version
.
Implementations§
source§impl KeysOptions
impl KeysOptions
sourcepub const fn new() -> KeysOptions
pub const fn new() -> KeysOptions
Create a new iterator options with default values.
sourcepub fn set_prefetch_size(&mut self, prefetch_size: usize) -> &mut KeysOptions
pub fn set_prefetch_size(&mut self, prefetch_size: usize) -> &mut KeysOptions
Set the number of KV pairs to prefetch while iterating.
sourcepub const fn with_prefetch_size(self, prefetch_size: usize) -> KeysOptions
pub const fn with_prefetch_size(self, prefetch_size: usize) -> KeysOptions
Set the number of KV pairs to prefetch while iterating.
sourcepub fn set_reverse(&mut self, reverse: bool) -> &mut KeysOptions
pub fn set_reverse(&mut self, reverse: bool) -> &mut KeysOptions
Set the direction of iteration. False is forward, true is backward.
sourcepub const fn with_reverse(self, reverse: bool) -> KeysOptions
pub const fn with_reverse(self, reverse: bool) -> KeysOptions
Set the direction of iteration. False is forward, true is backward.
sourcepub fn set_all_versions(&mut self, all_versions: bool) -> &mut KeysOptions
pub fn set_all_versions(&mut self, all_versions: bool) -> &mut KeysOptions
Set whether to fetch all valid versions of the same key.
sourcepub const fn with_all_versions(self, all_versions: bool) -> KeysOptions
pub const fn with_all_versions(self, all_versions: bool) -> KeysOptions
Set whether to fetch all valid versions of the same key.
sourcepub fn set_since_version(&mut self, since_version: u64) -> &mut KeysOptions
pub fn set_since_version(&mut self, since_version: u64) -> &mut KeysOptions
Set the version to start reading from.
sourcepub const fn with_since_version(self, since_version: u64) -> KeysOptions
pub const fn with_since_version(self, since_version: u64) -> KeysOptions
Set the version to start reading from.
Trait Implementations§
source§impl Clone for KeysOptions
impl Clone for KeysOptions
source§fn clone(&self) -> KeysOptions
fn clone(&self) -> KeysOptions
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for KeysOptions
impl Debug for KeysOptions
source§impl Default for KeysOptions
impl Default for KeysOptions
source§fn default() -> KeysOptions
fn default() -> KeysOptions
source§impl Hash for KeysOptions
impl Hash for KeysOptions
source§impl PartialEq for KeysOptions
impl PartialEq for KeysOptions
source§fn eq(&self, other: &KeysOptions) -> bool
fn eq(&self, other: &KeysOptions) -> bool
self
and other
values to be equal, and is used
by ==
.impl Copy for KeysOptions
impl Eq for KeysOptions
impl StructuralPartialEq for KeysOptions
Auto Trait Implementations§
impl Freeze for KeysOptions
impl RefUnwindSafe for KeysOptions
impl Send for KeysOptions
impl Sync for KeysOptions
impl Unpin for KeysOptions
impl UnwindSafe for KeysOptions
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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
key
and return true
if they are equal.