Struct mtbl::Merger [] [src]

pub struct Merger {
    pub merge_fn: Box<Box<MergeFn>>,
    // some fields omitted
}

An MTBL reader that opens and reads from several MTBL files, merging their contents.

An MTBL can have only one value for a key, so when the inputs have a key collision (more than one source contains the same key), it uses a MergeFn to combine them.

Fields

The function used to combine values for colliding keys.

Methods

impl Merger
[src]

A default MTBL merging function that chooses the last (second) value for the colliding key.

A simple MTBL merging function that chooses the first value for the colliding key.

Create a merger from a collection of other sources. Note that you must provide a merge_fn to combine values for colliding keys.

Add an additional source of data to be merged.

Trait Implementations

impl Read for Merger
[src]

Get the internal mtbl_source pointer.

Get the value of a key, if it's present.

Get an iterator over all keys and values.

Get an iterator over all keys and values where the key starts with the given prefix.

Get an iterator over all keys and values, where the keys are between key0 and key1 (inclusive). Read more

impl<'a> IntoIterator for &'a Merger
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

impl Drop for Merger
[src]

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

impl Send for Merger
[src]

Merger is thread-safe.

impl Sync for Merger
[src]

Merger is thread-safe.