pub struct BasicHistory { /* private fields */ }Expand description
A simple history implementation that holds entries in memory.
Trait Implementations§
Source§impl Default for BasicHistory
impl Default for BasicHistory
Source§fn default() -> BasicHistory
fn default() -> BasicHistory
Returns the “default value” for a type. Read more
Source§impl History for BasicHistory
impl History for BasicHistory
Source§fn get(&self, idx: HistoryIndex) -> Option<Cow<'_, str>>
fn get(&self, idx: HistoryIndex) -> Option<Cow<'_, str>>
Lookup the line corresponding to an index.
Source§fn last(&self) -> Option<HistoryIndex>
fn last(&self) -> Option<HistoryIndex>
Return the index for the most recently added entry.
Source§fn add(&mut self, line: &str)
fn add(&mut self, line: &str)
Add an entry.
Note that the LineEditor will not automatically call
the add method.
Source§fn search(
&self,
idx: HistoryIndex,
style: SearchStyle,
direction: SearchDirection,
pattern: &str,
) -> Option<SearchResult<'_>>
fn search( &self, idx: HistoryIndex, style: SearchStyle, direction: SearchDirection, pattern: &str, ) -> Option<SearchResult<'_>>
Search for a matching entry relative to the specified history index.
Auto Trait Implementations§
impl Freeze for BasicHistory
impl RefUnwindSafe for BasicHistory
impl Send for BasicHistory
impl Sync for BasicHistory
impl Unpin for BasicHistory
impl UnwindSafe for BasicHistory
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