#persistent #auto-merge #document #state #user #compact #change

automerge-persistent

The core library for managing persistent state of Automerge documents

5 releases (3 breaking)

0.4.0 May 13, 2023
0.3.1 Mar 8, 2023
0.3.0 Mar 8, 2023
0.2.0 Dec 20, 2022
0.1.0 Sep 26, 2022

#4 in #automerge

26 downloads per month
Used in 3 crates

MIT license

30KB
493 lines

A library for constructing efficient persistent automerge documents.

A PersistentAutomerge wraps an automerge::Automerge and handles making the changes applied to it durable. This works by persisting every change before it is applied to the document. Then occasionally the user should call compact to save the document in a more compact format and cleanup the included changes. This strategy aims to be fast while also being space efficient (up to the user's requirements).

let persister = MemoryPersister::default();
let doc = PersistentAutomerge::load(persister).unwrap();

Dependencies

~4.5MB
~99K SLoC