Transactional Iterator
A Transaction can be used to make changes to an iterator and only apply the changes if the
transaction is committed. When the Transaction is aborted, the changes are discarded. This
is useful for implementing backtracking searches, parsers, undo functionality, unlimited
peeking and more.
The original iterator must implement 'Clone' to be useable with the transactional iterator. Transactions must be either committed or aborted, just dropping them will cause in a panic.
Feature Flags
Transactions must be either committed or aborted. By default this is enforced with the 'panic_on_drop' feature flag. Disabling this feature flag allows transactions to be silently dropped which aborts the transaction.
Example
use Transaction;
let mut iter = vec!.into_iter;
let mut transaction = new;
// iterate within the transaction
assert_eq!;
assert_eq!;
// Commit the transaction
transaction.commit;
// The changes are now applied
assert_eq!;