1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#![cfg_attr(feature = "nightly", deny(missing_docs))]
#![cfg_attr(feature = "nightly", feature(external_doc))]
#![cfg_attr(feature = "nightly", doc(include = "../README.md"))]
#![cfg_attr(test, deny(warnings))]
#![forbid(unsafe_code, missing_debug_implementations)]

#[macro_use]
extern crate failure;

mod error;

pub use error::{Error, ErrorKind, Result};

/// Representation of two differences between two states.
#[derive(Debug, Clone)]
pub enum Ops {
  /// All instructions have been executed, ignore the rest of the array.
  Done,
  /// The element from array A at the first index is equivalent to the element
  /// from array B at the second index.
  Noop((u32, u32)),
  /// Move the element from array A at the first index into array B *before* the
  /// second index.
  Move((u32, u32)),
  /// Delete the element from array B at `index`.
  Delete(u32),
  /// Replace the element from array B at the second index with the element from
  /// array A at the first index.
  Replace((u32, u32)),
}