[][src]Trait rustc_ap_rustc_data_structures::undo_log::UndoLogs

pub trait UndoLogs<T> {
    pub fn num_open_snapshots(&self) -> usize;
pub fn push(&mut self, undo: T);
pub fn clear(&mut self); pub fn in_snapshot(&self) -> bool { ... }
pub fn extend<I>(&mut self, undos: I)
    where
        I: IntoIterator<Item = T>
, { ... } }

A trait which allows undo actions (T) to be pushed which can be used to rollback actio at a later time if needed.

The undo actions themselves are opaque to UndoLogs, only specified Rollback implementations need to know what an action is and how to reverse it.

Required methods

pub fn num_open_snapshots(&self) -> usize[src]

How many open snapshots this undo log currently has

pub fn push(&mut self, undo: T)[src]

Pushes a new "undo item" onto the undo log. This method is invoked when some action is taken (e.g., a variable is unified). It records the info needed to reverse that action should an enclosing snapshot be rolleod back.

pub fn clear(&mut self)[src]

Removes all items from the undo log.

Loading content...

Provided methods

pub fn in_snapshot(&self) -> bool[src]

True if a snapshot has started, false otherwise

pub fn extend<I>(&mut self, undos: I) where
    I: IntoIterator<Item = T>, 
[src]

Extends the undo log with many undos.

Loading content...

Implementations on Foreign Types

impl<'a, T, U> UndoLogs<T> for &'a mut U where
    U: UndoLogs<T>, 
[src]

Loading content...

Implementors

impl<T> UndoLogs<T> for NoUndo[src]

impl<T> UndoLogs<T> for VecLog<T>[src]

Loading content...