undo_stack
As I've been developing plugins and web audio software in Rust, I realized I needed to implement undo/redo. Not finding anything that looked relatively simple, I decided to spend some time to make something that would fit my needs.
The result is undo_stack, which allows storing tags and POD. In this case, POD is more specifically anything that implements bytemuck's POD trait. Bytemuck is a great choice as it's the common crate used for converting data to and from bytes in Rust, and it supports conversions for all of Rust's built-in types. Aside from alignment concenrs, this conversion is basically a no-op. As a result, undo_stack imposes almost no overhead other than managing the current state of the undo/redo sequencing.
On a functional level, undo_stack does what a user would expect from undo/redo- calling undo will give the previous value of the tag last submitted, or the initial value of the tag if there is no previous value. When redoing, it gives the most recent value for a given tag (or no value if the current value is the same as the most recent value). Changing a value whilst in the middle of the stack will pop everything ahead of the cursor off the stack.