pub trait Reversible<S>: Debug {
// Required methods
fn forward(&self, state: &mut S);
fn backward(&self, state: &mut S);
// Provided method
fn description(&self) -> &str { ... }
}Expand description
A reversible operation on state S.
§Laws
- Round-trip:
forward(s); backward(s)restoressto its original value. - Round-trip (reverse):
backward(s); forward(s)also restoress.
Required Methods§
Provided Methods§
Sourcefn description(&self) -> &str
fn description(&self) -> &str
Human-readable description of this operation.