cset

Crates.iocset
lib.rscset
version0.1.1
sourcesrc
created_at2022-12-22 23:34:04.907547
updated_at2022-12-24 02:16:20.606055
descriptionFine-grained and reversible struct transactions
homepage
repositoryhttps://github.com/nickdbush/cset
max_upload_size
id744172
size5,840
Nicholas Bush (nickdbush)

documentation

README

drates.io docs.rs

cset

Fine-grained and reversible struct transactions.

This crate offers a Track macro that structs can derive to generate the plumbing needed to precisely track changes to fields. Calling Trackable::edit() returns a Draft that stores edits separately from the underyling struct, such that no values are written.

When .commit() is called on the draft, edits are applied to the base struct. Each replaced value is returned to the caller as a Change in a ChangeSet. This changeset can then be re-applied to a struct of the same type, which replaces fields with values from the ChangeSet. This operation produces a new ChangeSet, allowing for the implementation of an undo-redo paradigm.

Project status

This project is early in development and API changes should be expected.

Commit count: 6

cargo fmt