pub struct TreeModel {
pub filter: FilterMode,
pub query: String,
pub show_label_timestamps: bool,
/* private fields */
}Expand description
The navigator model.
Fields§
§filter: FilterModeFilter mode.
query: StringSearch query.
show_label_timestamps: boolShow label timestamps.
Implementations§
Source§impl TreeModel
impl TreeModel
Sourcepub fn from_json(data: &JsonValue, home: Option<String>) -> Self
pub fn from_json(data: &JsonValue, home: Option<String>) -> Self
Builds the model from get_tree data ({tree, leafId}).
Sourcepub fn new(
roots: &[TreeNode],
leaf_id: Option<String>,
home: Option<String>,
) -> Self
pub fn new( roots: &[TreeNode], leaf_id: Option<String>, home: Option<String>, ) -> Self
Builds the model from parsed roots.
Sourcepub fn selected_entry(&self) -> Option<&SessionEntry>
pub fn selected_entry(&self) -> Option<&SessionEntry>
Selected entry.
Sourcepub fn selected_label(&self) -> Option<&str>
pub fn selected_label(&self) -> Option<&str>
Label of the selected entry.
Sourcepub fn fold_or_up(&mut self)
pub fn fold_or_up(&mut self)
A p p . t r e e . f o l d O r U p.
Sourcepub fn unfold_or_down(&mut self)
pub fn unfold_or_down(&mut self)
A p p . t r e e . u n f o l d O r D o w n.
Sourcepub fn set_filter(&mut self, mode: FilterMode)
pub fn set_filter(&mut self, mode: FilterMode)
Sets the filter mode (clears folds).
Sourcepub fn toggle_filter(&mut self, mode: FilterMode)
pub fn toggle_filter(&mut self, mode: FilterMode)
Toggle semantics: mode ↔ default.
Sourcepub fn cycle_filter(&mut self, forward: bool)
pub fn cycle_filter(&mut self, forward: bool)
Cycles the filter.
Sourcepub fn set_label(
&mut self,
entry_id: &str,
label: Option<String>,
timestamp: Option<String>,
)
pub fn set_label( &mut self, entry_id: &str, label: Option<String>, timestamp: Option<String>, )
Updates a label after _oino/set_label.
Sourcepub fn rows(&self, start: usize, end: usize) -> Vec<TreeRow>
pub fn rows(&self, start: usize, end: usize) -> Vec<TreeRow>
Rows start..end of the visible list.
Sourcepub fn window(&self, height: usize) -> (usize, usize)
pub fn window(&self, height: usize) -> (usize, usize)
Windowing: centre the selection in height rows.
Sourcepub fn selected_copy_text(&self) -> Option<String>
pub fn selected_copy_text(&self) -> Option<String>
getEntryCopyText for the selected entry.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TreeModel
impl RefUnwindSafe for TreeModel
impl Send for TreeModel
impl Sync for TreeModel
impl Unpin for TreeModel
impl UnsafeUnpin for TreeModel
impl UnwindSafe for TreeModel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more