pub trait History: Send {
fn append(&mut self, entry: &str);
fn iter_chronologic(&self) -> Iter<'_, String>;
fn back(&mut self);
fn forward(&mut self);
fn string_at_cursor(&self) -> Option<String>;
fn set_navigation(&mut self, navigation: HistoryNavigationQuery);
fn get_navigation(&self) -> HistoryNavigationQuery;
fn query_entries(&self, search: &str) -> Vec<String>;
fn max_values(&self) -> usize;
fn sync(&mut self) -> Result<()>;
fn reset_cursor(&mut self);
}
Expand description
Interface of a history datastructure that supports stateful navigation via HistoryNavigationQuery
.
Required Methods
Append entry to the history, if capacity management is part of the implementation may perform that as well
fn iter_chronologic(&self) -> Iter<'_, String>
fn iter_chronologic(&self) -> Iter<'_, String>
Chronologic interaction over all entries present in the history
This moves the cursor backwards respecting the navigation query that is set
- Results in a no-op if the cursor is at the initial point
This moves the cursor forwards respecting the navigation-query that is set
- Results in a no-op if the cursor is at the latest point
fn string_at_cursor(&self) -> Option<String>
fn string_at_cursor(&self) -> Option<String>
Returns the string (if present) at the cursor
Set a new navigation mode for search based on input query defined in HistoryNavigationQuery
By current convention, resets the position in the stateful browsing to the default.
Poll the current HistoryNavigationQuery
mode
fn query_entries(&self, search: &str) -> Vec<String>
fn query_entries(&self, search: &str) -> Vec<String>
Query the values in the history entries
fn max_values(&self) -> usize
fn max_values(&self) -> usize
Max number of values that can be queried from the history
Synchronize the state of the history with the backing filesystem or database if available
fn reset_cursor(&mut self)
fn reset_cursor(&mut self)
Reset the browsing cursor back outside the history, does not affect the HistoryNavigationQuery