Struct termwiz::lineedit::BasicHistory
source · [−]pub struct BasicHistory { /* private fields */ }
Expand description
A simple history implementation that holds entries in memory.
Trait Implementations
sourceimpl Default for BasicHistory
impl Default for BasicHistory
sourcefn default() -> BasicHistory
fn default() -> BasicHistory
Returns the “default value” for a type. Read more
sourceimpl History for BasicHistory
impl History for BasicHistory
sourcefn get(&self, idx: HistoryIndex) -> Option<Cow<'_, str>>
fn get(&self, idx: HistoryIndex) -> Option<Cow<'_, str>>
Lookup the line corresponding to an index.
sourcefn last(&self) -> Option<HistoryIndex>
fn last(&self) -> Option<HistoryIndex>
Return the index for the most recently added entry.
sourcefn 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. Read more
sourcefn 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 RefUnwindSafe for BasicHistory
impl Send for BasicHistory
impl Sync for BasicHistory
impl Unpin for BasicHistory
impl UnwindSafe for BasicHistory
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more