Struct mtbl::SorterOptions
[−]
[src]
pub struct SorterOptions { pub temp_dir: Option<PathBuf>, pub max_memory: Option<usize>, }
Options used to create a Sorter
.
Fields
temp_dir: Option<PathBuf>
The temporary directory to be used for intermediate files. Default is "/var/tmp".
max_memory: Option<usize>
The amount of RAM to use for storing intermediate files, in bytes. Default is 1 GiB.
Methods
impl SorterOptions
[src]
fn new() -> SorterOptions
Create a new SorterOptions
with defaults.
fn temp_dir<T: AsRef<Path>>(&self, path: T) -> SorterOptions
Create a new SorterOptions
with temp_dir set.
fn max_memory(&self, max_memory: usize) -> SorterOptions
Create a new SorterOptions
with max_memory set.
fn create_from_writer<F>(&self, writer: Writer, merge_fn: F) -> Sorter where
F: Fn(&[u8], &[u8], &[u8]) -> Vec<u8> + 'static,
F: Fn(&[u8], &[u8], &[u8]) -> Vec<u8> + 'static,
Create a new Sorter
with these options.
Once sorting is done, the resulting sequence will be written to the supplied Writer
. Note
that a MergeFn
must be supplied to combine values for entries with colliding keys.
fn create_from_path<T, F>(&self, path: T, merge_fn: F) -> IOResult<Sorter> where
T: AsRef<Path>,
F: Fn(&[u8], &[u8], &[u8]) -> Vec<u8> + 'static,
T: AsRef<Path>,
F: Fn(&[u8], &[u8], &[u8]) -> Vec<u8> + 'static,
Create a new Sorter
with these options.
Once sorting is done, the resulting sequence will be written to the supplied path. Note
that a MergeFn
must be supplied to combine values for entries with colliding keys.
fn create_from_file<T, F>(&self, file: T, merge_fn: F) -> IOResult<Sorter> where
T: 'static + AsRawFd,
F: Fn(&[u8], &[u8], &[u8]) -> Vec<u8> + 'static,
T: 'static + AsRawFd,
F: Fn(&[u8], &[u8], &[u8]) -> Vec<u8> + 'static,
Create a new Sorter
with these options.
Once sorting is done, the resulting sequence will be written to the supplied path. Note
that a MergeFn
must be supplied to combine values for entries with colliding keys.
Trait Implementations
impl Clone for SorterOptions
[src]
fn clone(&self) -> SorterOptions
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