Struct grenad::Sorter[][src]

pub struct Sorter<MF, CC: ChunkCreator = DefaultChunkCreator> { /* fields omitted */ }
Expand description

A struct you can use to automatically sort and merge duplicate entries.

You can insert key-value pairs in arbitrary order, it will use the ChunkCreator and you the generated chunks to buffer when the dump_threashold setting is reached.

Implementations

Creates a SorterBuilder from a merge function, it can be used to configure your Sorter to better fit your needs.

Creates a Sorter from a merge function, with the default parameters.

A rough estimate of how much memory usage it will take on the disk once dumped to disk.

This is a very bad estimate in the sense that it does not calculate the amount of duplicate entries that are in the dumped chunks and neither the fact that the in-memory buffer will likely be compressed once written to disk. This estimate will always be greater than the actual end space usage on disk.

Insert an entry into the Sorter making sure that conflicts are resolved by the provided merge function.

Consumes this Sorter and streams the entries to the Writer given in parameter.

Consumes this Sorter and outputs a stream of the merged entries in key-order.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.