rundo

Crates.iorundo
lib.rsrundo
version0.4.0
sourcesrc
created_at2018-02-05 02:41:30.199047
updated_at2018-04-06 04:45:37.766805
descriptionRundo is a redo / undo library for rust which can auto generate undo op. Below is an example to use Rundo.
homepagehttps://github.com/M-Adoo/rundo
repositoryhttps://github.com/M-Adoo/rundo
max_upload_size
id49657
size46,520,174
Adoo (M-Adoo)

documentation

https://docs.rs/rundo

README

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.

Commit count: 58

cargo fmt