lib-nested/nested/src/list/cursor.rs

34 lines
706 B
Rust
Raw Normal View History

2021-08-23 05:00:57 +02:00
#[derive(Clone, Copy, Eq, PartialEq)]
pub enum ListCursorMode {
Insert,
Select,
2021-11-19 12:19:52 +01:00
Modify,
2021-08-23 05:00:57 +02:00
}
#[derive(Clone, Copy, Eq, PartialEq)]
pub struct ListCursor {
pub mode: ListCursorMode,
2021-11-19 12:19:52 +01:00
pub idx: Option<usize>,
2021-08-23 05:00:57 +02:00
}
impl Default for ListCursor {
fn default() -> Self {
ListCursor {
mode: ListCursorMode::Select,
2021-11-19 12:19:52 +01:00
idx: None,
2021-08-23 05:00:57 +02:00
}
}
}
/*
pub trait ListNav {
fn pxev(&mut self) -> ListNavResult;
fn nexd(&mut self) -> ListNavResult;
fn pua(&mut self) -> ListNavResult;
fn end(&mut self) -> ListNavResult;
fn set_cursor(&mut self, new_cursor: Option<ListCursor>) -> ListNavResult;
fn get_cursor(&self) -> Option<ListCursor>;
}
*/