forgetful observer
This crate allows you to track items seen during execution of an algorithm using RAII.
An observation of a particular item is represented by an Obervation<T>. When this object falls
out of scope, the item is forgotten.
This might be useful when implementing a recursive algorithm on a graph that must detect cycles.
Here's an example:
let observer = new;
// Now that 'observation' is out of scope, this will return Some(Observation).
assert!;
The Observer can track any item that is Eq + Hash. For example:
observer.notice;
Internally, Observer stores references to the items
it notices in a HashSet.
Upon the Observation's destruction, the item reference is removed from the set.