Trait rustc_ap_rustc_data_structures::undo_log::UndoLogs [−][src]
pub trait UndoLogs<T> { fn num_open_snapshots(&self) -> usize; fn push(&mut self, undo: T); fn clear(&mut self); fn in_snapshot(&self) -> bool { ... } fn extend<I>(&mut self, undos: I)
where
I: IntoIterator<Item = T>, { ... } }
Expand description
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
fn num_open_snapshots(&self) -> usize
[src]
fn num_open_snapshots(&self) -> usize
[src]How many open snapshots this undo log currently has
Provided methods
fn in_snapshot(&self) -> bool
[src]
fn in_snapshot(&self) -> bool
[src]True if a snapshot has started, false otherwise
fn extend<I>(&mut self, undos: I) where
I: IntoIterator<Item = T>,
[src]
fn extend<I>(&mut self, undos: I) where
I: IntoIterator<Item = T>,
[src]Extends the undo log with many undos.
Implementations on Foreign Types
impl<'a, T, U> UndoLogs<T> for &'a mut U where
U: UndoLogs<T>,
[src]
impl<'a, T, U> UndoLogs<T> for &'a mut U where
U: UndoLogs<T>,
[src]pub fn in_snapshot(&self) -> bool
[src]
pub fn num_open_snapshots(&self) -> usize
[src]
pub fn push(&mut self, undo: T)
[src]
pub fn clear(&mut self)
[src]
pub fn extend<I>(&mut self, undos: I) where
I: IntoIterator<Item = T>,
&'a mut U: Sized,
[src]
I: IntoIterator<Item = T>,
&'a mut U: Sized,