#undo #redo

nightly macro rundo_attrs

macros lib by rundo

8 unstable releases (3 breaking)

Uses old Rust 2015

0.4.0 Apr 6, 2018
0.3.2 Feb 23, 2018
0.2.2 Feb 23, 2018
0.1.1 Feb 5, 2018

#8 in #data-control

Download history 10/week @ 2023-11-02 13/week @ 2023-11-09 7/week @ 2023-11-16 13/week @ 2023-11-23 29/week @ 2023-11-30 5/week @ 2023-12-07 12/week @ 2023-12-14 19/week @ 2023-12-21 3/week @ 2023-12-28 4/week @ 2024-01-04 4/week @ 2024-01-11 19/week @ 2024-01-18 12/week @ 2024-01-25 9/week @ 2024-02-01 14/week @ 2024-02-08 90/week @ 2024-02-15

125 downloads per month
Used in rundo

MIT license

26KB
737 lines

Rundo

Build Status Coverage Status

Rundo is a redo / undo library for rust which can auto generate undo op. Below is an example to use Rundo.

#![feature(proc_macro)]
#![feature(decl_macro)]

extern crate rundo;
use rundo::prelude::*;

#[rundo]
struct Point {
    x: f32,
    y: f32,
}

fn main(){

  let mut space = Workspace::new(Point! {x: 2.0, y: 2.0,});
  *space.get_mut().x = 3.0;

  // x was changed to 3.0
  assert_eq!(*space.data.x, 3.0);

  // x will undo to 2.0
  space.undo();
  assert_eq!(*space.data.x, 2.0);

  // x will redo to 3.0
  space.redo();
  assert_eq!(*space.data.x, 3.0);
}

Documents

Library API

Quick Start 2 min learn how to use Rundo.

Dependencies

~2MB
~46K SLoC