pub struct HistoryManager { /* private fields */ }Expand description
Command history manager
Implementations§
Source§impl HistoryManager
impl HistoryManager
Sourcepub fn new(max_size: usize) -> ReplResult<Self>
pub fn new(max_size: usize) -> ReplResult<Self>
Create a new history manager
Sourcepub fn new_persistent(max_size: usize, history_dir: &Path) -> ReplResult<Self>
pub fn new_persistent(max_size: usize, history_dir: &Path) -> ReplResult<Self>
Create a new persistent history manager
Sourcepub fn add_command(&mut self, command: &str) -> ReplResult<()>
pub fn add_command(&mut self, command: &str) -> ReplResult<()>
Add a command to history
Sourcepub fn add_command_with_result(
&mut self,
command: &str,
duration: Duration,
success: bool,
) -> ReplResult<()>
pub fn add_command_with_result( &mut self, command: &str, duration: Duration, success: bool, ) -> ReplResult<()>
Add a command with execution details
Sourcepub fn recent_commands(&self, limit: usize) -> Vec<String>
pub fn recent_commands(&self, limit: usize) -> Vec<String>
Get recent commands
Sourcepub fn search(&self, filter: &HistoryFilter) -> Vec<&HistoryEntry>
pub fn search(&self, filter: &HistoryFilter) -> Vec<&HistoryEntry>
Search history with filter
Sourcepub fn reset_position(&mut self)
pub fn reset_position(&mut self)
Reset navigation position
Sourcepub fn stats(&self) -> &HistoryStats
pub fn stats(&self) -> &HistoryStats
Get history statistics
Sourcepub fn save_history(&self) -> ReplResult<()>
pub fn save_history(&self) -> ReplResult<()>
Save all history to file
Sourcepub fn clear(&mut self) -> ReplResult<()>
pub fn clear(&mut self) -> ReplResult<()>
Clear all history
Sourcepub fn export_text(&self) -> String
pub fn export_text(&self) -> String
Export history as text
Sourcepub fn export_detailed(&self) -> String
pub fn export_detailed(&self) -> String
Export history with metadata
Auto Trait Implementations§
impl Freeze for HistoryManager
impl RefUnwindSafe for HistoryManager
impl Send for HistoryManager
impl Sync for HistoryManager
impl Unpin for HistoryManager
impl UnsafeUnpin for HistoryManager
impl UnwindSafe for HistoryManager
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more