pub struct ReaderOptions {
pub verify_checksums: Option<bool>,
pub madvise_random: Option<bool>,
}
Expand description
MTBL Reader opening options.
Fields§
§verify_checksums: Option<bool>
Whether or not the CRC32C checksum on each data block should be verified or not. If verify_checksums is enabled, a checksum mismatch will cause a runtime error. The mtbl default is false.
madvise_random: Option<bool>
Specifies whether the kernel should be advised if the data access patterns are expected to be random or not. This may hurt some workloads but help others. This defaults to false.
This option can be explicitly overridden by setting the environment variable MTBL_READER_MADVISE_RANDOM to the string “0” (force disable) or “1” (force enable).
This option only has any effect on systems that have the posix_madvise or madvise system calls.
Implementations§
Source§impl ReaderOptions
impl ReaderOptions
Sourcepub fn new() -> ReaderOptions
pub fn new() -> ReaderOptions
Create a ReaderOptions containing only defaults.
Sourcepub fn verify_checksums(&self, verify_checksums: bool) -> ReaderOptions
pub fn verify_checksums(&self, verify_checksums: bool) -> ReaderOptions
Create a new options with verify_checksums set.
Sourcepub fn madvise_random(&self, madvise_random: bool) -> ReaderOptions
pub fn madvise_random(&self, madvise_random: bool) -> ReaderOptions
Create a new options with madvise_random set.
Trait Implementations§
Source§impl Clone for ReaderOptions
impl Clone for ReaderOptions
Source§fn clone(&self) -> ReaderOptions
fn clone(&self) -> ReaderOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more