← All projects

carrot

prerelease

Document engine for Rust applications. Records with stable IDs, validated transactions, undo/redo history, verified project files, and crash recovery for diagram editors, drawing tools, and map editors.

Rust oss-labs/carrot

Why it exists

Diagram editors, drawing tools, and map editors all need the same things underneath: records with stable IDs, edits that apply completely or not at all, history that does not copy the whole document, saves that cannot corrupt the previous file, and a way back after a crash. Carrot supplies that layer. You define what your records mean; Carrot stores them and checks the relationships you declare.

What it does

Transactions are validated as a whole before they publish, and snapshots share unchanged data, so keeping history does not duplicate the document. An optional query crate caches derived results and tracks which records they read, so a changed input invalidates only its dependents: on a 1,000-record workload that cut cold allocation from 8.5 MB to 51 KB. An optional geometry crate does exact integer predicates, polygon booleans, and spatial queries with no fixed vertex ceiling. Documents on disk are content-addressed archives with SHA-256 verified revisions and named checkpoints, and large assets stream through a block store instead of loading into memory. It is prerelease, and durable saving is qualified on Unix only.