Struct mtbl::ReaderOptions
[−]
[src]
pub struct ReaderOptions { pub verify_checksums: Option<bool>, pub madvise_random: Option<bool>, }
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.
Methods
impl ReaderOptions
[src]
fn new() -> ReaderOptions
Create a ReaderOptions containing only defaults.
fn verify_checksums(self: &Self, verify_checksums: bool) -> ReaderOptions
Create a new options with verify_checksums set.
fn madvise_random(self: &Self, madvise_random: bool) -> ReaderOptions
Create a new options with madvise_random set.
fn open_from_path<T: AsRef<Path>>(self: &Self, path: T) -> IOResult<Reader>
Open an MTBL reader with these options from a file described by the given path.
fn open_from_file<T: 'static + AsRawFd>(self: &Self, file: &T) -> IOResult<Reader>
Open an MTBL reader with these options from a file object.
Trait Implementations
impl Clone for ReaderOptions
[src]
fn clone(&self) -> ReaderOptions
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more