Module engine_traits::iterable[][src]

Iteration over engines and snapshots.

For the purpose of key/value iteration, TiKV defines its own Iterator trait, and Iterable types that can create iterators.

Both KvEngines and Snapshots are Iterable.

Iteration is performed over consistent views into the database, even when iterating over the engine without creating a Snapshot. That is, iterating over an engine behaves implicitly as if a snapshot was created first, and the iteration is being performed on the snapshot.

Iterators can be in an invalid state, in which they are not positioned at a key/value pair. This can occur when attempting to move before the first pair, past the last pair, or when seeking to a key that does not exist. There may be other conditions that invalidate iterators (TODO: I don’t know).

An invalid iterator cannot move forward or back, but may be returned to a valid state through a successful “seek” operation.

As TiKV inherits its iteration semantics from RocksDB, the RocksDB documentation is the ultimate reference:

Enums

SeekKey

A token indicating where an iterator “seek” operation should stop.

Traits

Iterable
Iterator

An iterator over a consistent set of keys and values.

Functions

collect

Collect all items of it into a vector, generally used for tests.

scan_impl