Trait cop::Rewind

source ·
pub trait Rewind<T> {
    // Required method
    fn rewind(&mut self, state: T);
}
Expand description

Restore the state of mutable data structures.

In the presence of backtracking, mutable data structures (such as the substitution) often need to be reset to an earlier state. Such data structures should implement Rewind<T> if T is a cheap and small characterisation of their state.

Required Methods§

source

fn rewind(&mut self, state: T)

Rewind to some state.

Implementations on Foreign Types§

source§

impl<T> Rewind<usize> for Vec<T>

source§

fn rewind(&mut self, state: usize)

Implementors§

source§

impl<T: Rewind<R>, R> Rewind<PutRewind<T, R>> for T

source§

impl<T: Rewind<R>, R> Rewind<Context<R>> for Context<T>