factstr
factstr is the shared Rust contract crate for FACTSTR.
It defines the public event store contract and core types. It does not implement a store by itself.
Store implementations live in separate crates:
factstr-memoryfactstr-sqlitefactstr-postgres
Core operations
The core contract currently includes:
appendqueryappend_ifstream_allstream_tostream_all_durablestream_to_durable
Core types
The public contract includes:
NewEventEventRecordEventQueryEventFilterQueryResultAppendResultDurableStreamEventStreamEventStoreEventStoreError
Related stream handler types are also part of the crate:
HandleStreamStreamHandlerError
Semantics
Important contract semantics:
- facts are append-only
- sequence numbers are global and monotonically increasing
- one committed batch receives one consecutive sequence range
min_sequence_numberis a read cursor onlycurrent_context_versiondescribes the full matching conflict contextappend_ifchecks the full matching context- durable streams resume strictly after the stored cursor
Related crates
factstr-memoryfor the in-memory implementationfactstr-sqlitefor the SQLite implementationfactstr-postgresfor the PostgreSQL implementation