VecLog in rustc_data_structures::undo_log - Rust (original) (raw)

pub struct VecLog<T> {
    log: Vec<T>,
    num_open_snapshots: usize,
}

Expand description

A basic undo log.

Source§

Source§

Source§

Source§

Source§

The returned type after indexing.

Source§

Performs the indexing (container[index]) operation. Read more

Source§

Source§

Source§

Returns true if self has made any changes since snapshot started.

Source§

Returns the slice of actions that were taken since the snapshot began.

Source§

Starts a new snapshot. That snapshot must eventually either be committed via a call to commit or rollback via rollback_to. Snapshots can be nested (i.e., you can start a snapshot whilst another snapshot is in progress) but you must then commit or rollback the inner snapshot before attempting to commit or rollback the outer snapshot.

Source§

Rollback (undo) the changes made to storage since the snapshot.

Source§

Commit: keep the changes that have been made since the snapshot began

Source§

Source§

How many open snapshots this undo log currently has

Source§

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 rolled back.

Source§

Removes all items from the undo log.

Source§

True if a snapshot has started, false otherwise

Source§

Extends the undo log with many undos.

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 32 bytes