Struct mtbl::Writer [] [src]

pub struct Writer {
    pub options: WriterOptions,
    // some fields omitted
}

A struct to create an MTBL file from keys and values in sorted order.

Note that keys must be added in sorted order (by key), since they are written to disk. To create an MTBL providing keys in non-sorted order, use a Sorter.

To create a Writer with non-default options, see WriterOptions.

Examples

let mut writer = Writer::create_from_path("/tmp/f.mtbl");
writer.add("a", dat_a);
writer.add("b", dat_b);Run

Fields

The options used to create this MTBL file.

Methods

impl Writer
[src]

Create an empty MTBL file at the given path.

Create an empty MTBL file from the given File.

Get the underlying mtbl_writer pointer.

Add all elements from a sorted iterator.

If the inputs are not all sorted (and after all the elements already added to the Writer), the result will be an Err, and that element and all further elements will not be written to the MTBL file.

Trait Implementations

impl Write for Writer
[src]

Add a key-value pair to be written to the MTBL file.

Keys must be provided in sorted order. If keys are not provided in sorted order, this will result in an Err.

impl Drop for Writer
[src]

A method called when the value goes out of scope. Read more