Struct async_mwmr::IteratorOptions
source · pub struct IteratorOptions {
pub prefetch_size: usize,
pub prefetch_values: bool,
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
prefetch_values: bool
Indicates whether we should prefetch values during iteration and store them.
Some databases use key-value separation for optimization and this option can be used to prefetch values.
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 IteratorOptions
impl IteratorOptions
sourcepub const fn new() -> IteratorOptions
pub const fn new() -> IteratorOptions
Create a new iterator options with default values.
sourcepub fn set_prefetch_size(
&mut self,
prefetch_size: usize
) -> &mut IteratorOptions
pub fn set_prefetch_size( &mut self, prefetch_size: usize ) -> &mut IteratorOptions
Set the number of KV pairs to prefetch while iterating.
sourcepub const fn with_prefetch_size(self, prefetch_size: usize) -> IteratorOptions
pub const fn with_prefetch_size(self, prefetch_size: usize) -> IteratorOptions
Set the number of KV pairs to prefetch while iterating.
sourcepub fn set_prefetch_values(
&mut self,
prefetch_values: bool
) -> &mut IteratorOptions
pub fn set_prefetch_values( &mut self, prefetch_values: bool ) -> &mut IteratorOptions
Set whether we should prefetch values during iteration and store them.
sourcepub const fn with_prefetch_values(
self,
prefetch_values: bool
) -> IteratorOptions
pub const fn with_prefetch_values( self, prefetch_values: bool ) -> IteratorOptions
Set whether we should prefetch values during iteration and store them.
sourcepub fn set_reverse(&mut self, reverse: bool) -> &mut IteratorOptions
pub fn set_reverse(&mut self, reverse: bool) -> &mut IteratorOptions
Set the direction of iteration. False is forward, true is backward.
sourcepub const fn with_reverse(self, reverse: bool) -> IteratorOptions
pub const fn with_reverse(self, reverse: bool) -> IteratorOptions
Set the direction of iteration. False is forward, true is backward.
sourcepub fn set_all_versions(&mut self, all_versions: bool) -> &mut IteratorOptions
pub fn set_all_versions(&mut self, all_versions: bool) -> &mut IteratorOptions
Set whether to fetch all valid versions of the same key.
sourcepub const fn with_all_versions(self, all_versions: bool) -> IteratorOptions
pub const fn with_all_versions(self, all_versions: bool) -> IteratorOptions
Set whether to fetch all valid versions of the same key.
sourcepub fn set_since_version(&mut self, since_version: u64) -> &mut IteratorOptions
pub fn set_since_version(&mut self, since_version: u64) -> &mut IteratorOptions
Set the version to start reading from.
sourcepub const fn with_since_version(self, since_version: u64) -> IteratorOptions
pub const fn with_since_version(self, since_version: u64) -> IteratorOptions
Set the version to start reading from.
Trait Implementations§
source§impl Clone for IteratorOptions
impl Clone for IteratorOptions
source§fn clone(&self) -> IteratorOptions
fn clone(&self) -> IteratorOptions
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for IteratorOptions
impl Debug for IteratorOptions
source§impl Default for IteratorOptions
impl Default for IteratorOptions
source§fn default() -> IteratorOptions
fn default() -> IteratorOptions
source§impl Hash for IteratorOptions
impl Hash for IteratorOptions
source§impl PartialEq for IteratorOptions
impl PartialEq for IteratorOptions
source§fn eq(&self, other: &IteratorOptions) -> bool
fn eq(&self, other: &IteratorOptions) -> bool
self
and other
values to be equal, and is used
by ==
.impl Copy for IteratorOptions
impl Eq for IteratorOptions
impl StructuralPartialEq for IteratorOptions
Auto Trait Implementations§
impl Freeze for IteratorOptions
impl RefUnwindSafe for IteratorOptions
impl Send for IteratorOptions
impl Sync for IteratorOptions
impl Unpin for IteratorOptions
impl UnwindSafe for IteratorOptions
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.