Skip to main content

graphrefly_structures/
lib.rs

1//! `GraphReFly` reactive data structures (M5.A — D177/D178/D179).
2//!
3//! Four reactive structures backed by pluggable backends, integrated at
4//! the Core level (no Graph dependency required):
5//!
6//! - [`ReactiveLog`] — append-only log with optional ring-buffer cap
7//! - [`ReactiveList`] — ordered list with positional insert/pop
8//! - [`ReactiveMap`] — key-value map with set/delete operations
9//! - [`ReactiveIndex`] — sorted index with primary key lookup + secondary sort
10//!
11//! Each structure owns a Core state `NodeId` and emits DIRTY→DATA snapshots
12//! on every mutation. Optional `mutation_log` companions record typed
13//! `BaseChange<XxxChange<T>>` deltas for op-log changesets (Phase 14).
14//!
15//! Default backends use `Vec<T>` / `HashMap<K, V>`. `imbl`-backed persistent
16//! backends are deferred until bench evidence justifies (D178).
17//!
18//! CRDT-backed variants (yrs / automerge / loro / diamond-types) are
19//! post-1.0 work, gated behind feature flags.
20
21#![warn(rust_2018_idioms, unreachable_pub)]
22#![warn(clippy::pedantic)]
23#![allow(
24    clippy::module_name_repetitions,
25    clippy::missing_errors_doc,
26    clippy::missing_panics_doc,
27    clippy::must_use_candidate,
28    clippy::cast_possible_wrap,
29    clippy::cast_possible_truncation,
30    clippy::cast_sign_loss,
31    clippy::type_complexity,
32    clippy::doc_markdown
33)]
34#![forbid(unsafe_code)]
35
36pub mod backend;
37pub mod changeset;
38pub mod reactive;
39
40// Re-export core types for ergonomic access.
41pub use backend::{
42    HashMapBackend, IndexBackend, IndexRow, ListBackend, LogBackend, MapBackend, VecIndexBackend,
43    VecListBackend, VecLogBackend,
44};
45pub use changeset::{
46    BaseChange, DeleteReason, IndexChange, Lifecycle, ListChange, LogChange, MapChange, Version,
47};
48pub use reactive::{
49    AppendLogSink, AttachOptions, AttachStorageHandle, IndexEqualsFn, IndexOutOfBounds, InternFn,
50    LogView, MapConfigError, ReactiveIndex, ReactiveIndexOptions, ReactiveList,
51    ReactiveListOptions, ReactiveLog, ReactiveLogOptions, ReactiveMap, ReactiveMapOptions,
52    ReactiveSub, RetentionPolicy, ScanHandle, UpsertOptions, ViewSpec,
53};