34 lines
615 B
Rust
34 lines
615 B
Rust
use {
|
|
crate::list::ListCursorMode
|
|
};
|
|
|
|
//<<<<>>>><<>><><<>><<<*>>><<>><><<>><<<<>>>>
|
|
|
|
#[derive(Clone, Eq, PartialEq)]
|
|
pub struct TreeCursor {
|
|
pub leaf_mode: ListCursorMode,
|
|
pub tree_addr: Vec<isize>,
|
|
}
|
|
|
|
impl TreeCursor {
|
|
pub fn home() -> Self {
|
|
TreeCursor {
|
|
leaf_mode: ListCursorMode::Insert,
|
|
tree_addr: vec![0]
|
|
}
|
|
}
|
|
|
|
pub fn none() -> Self {
|
|
TreeCursor {
|
|
leaf_mode: ListCursorMode::Select,
|
|
tree_addr: vec![],
|
|
}
|
|
}
|
|
}
|
|
|
|
impl Default for TreeCursor {
|
|
fn default() -> Self {
|
|
TreeCursor::none()
|
|
}
|
|
}
|
|
|