lib-nested/nested/src/tree/cursor.rs
2022-12-18 01:39:01 +01:00

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()
}
}