Module infinitree::fields

source ·
Expand description

Traits and implementations for working with index members.

There are 3 ways to interact with an index field:

  • Store: Store the field into the index.
  • Query: Query the field and load selected values into memory.
  • Load: Load all contents of the field into memory.

To implement how a field is actually stored in the index, we define an access Strategy. Currently 2 access strategies are implemented in Infinitree, but the storage system is extensible.

  • SparseField: Store the key in the index, but the value in the object store
  • LocalField: Store both the key and the value in the index.

Additionally, infinitree can work with “snapshot” or “incremental” fields. This depth of the field will determine its behaviour during Load or Query operation.

This is a detail that you need to be aware of when designing your indexes, but the implementation details are only relevant if you intend to write your own field type.

  • Incremental: The entire commit list will be traversed, typically useful for incremental collection types.
  • Snapshot: Only the last commit is visited, restoring a point-in-time snapshot of the contents.

To learn more about index internals, see the module documentation in the index module.

Re-exports

Modules

Structs

  • Append-only linked list that only commits incremental changes
  • Multithreaded hash map that is always saved atomically
  • Allows using any serializable type as a member of the index
  • HashMap that tracks incremental changes between commits

Enums

Traits

  • Query an index field, but do not automatically load it into memory
  • Marker trait for value that can be used as a key in an index
  • Marker trait for values that can be serialized and used as a value for an index field

Type Definitions

  • Shortcut to Arc<RwLock<Vec<T>>>, that can be used in an Index