Struct history_tree::HistoryTree
[−]
[src]
pub struct HistoryTree { pub records: Vec<Record>, pub cursor: Option<usize>, }
Stores information about history tree relations.
Fields
records: Vec<Record>
Stores records.
cursor: Option<usize>
History cursor.
Points to an index of records where all previous changes
are active, and those after are inactive.
When set to None
, it is assumed to point to the latest version.
Methods
impl HistoryTree
[src]
fn new() -> HistoryTree
Creates a new history tree.
fn root(&self) -> usize
Gets the root.
fn cursor(&self) -> usize
Gets the cursor.
fn add(&mut self, parent: usize) -> usize
Add new node.
fn change(&mut self, node: &mut usize)
Change node.
fn delete(&mut self, node: usize)
Delete node.
fn children(&self, parent: usize) -> Vec<usize>
Gets the names of children.
fn undo(&mut self)
Goes back one step in history.
fn redo(&mut self)
Goes forward one step in history.
fn print(&self, parent: usize, tabs: u32)
Prints relations to standard output. This is used for debugging.
Trait Implementations
impl Clone for HistoryTree
[src]
fn clone(&self) -> HistoryTree
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for HistoryTree
[src]
impl PartialEq for HistoryTree
[src]
fn eq(&self, __arg_0: &HistoryTree) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &HistoryTree) -> bool
This method tests for !=
.