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 storeLocalField
: 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
pub use strategy::LocalField;
pub use strategy::SparseField;
pub use intent::Intent;
pub use intent::Load;
pub use intent::Query;
pub use intent::Store;
Modules
Transaction depth resolvers for custom Collection
types.
Serialization strategies for index fields
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
Result of a query predicate
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