Skip to main content

rush_sync_server/commands/history/
events.rs

1#[derive(Debug, Clone, PartialEq)]
2pub enum HistoryEvent {
3    Clear,
4    Add(String),
5    NavigatePrevious,
6    NavigateNext,
7    ResetPosition,
8}
9
10pub struct HistoryEventHandler;
11
12impl HistoryEventHandler {
13    pub fn handle_command_result(result: &str) -> Option<HistoryEvent> {
14        match result {
15            "__CLEAR_HISTORY__" => Some(HistoryEvent::Clear),
16            _ => None,
17        }
18    }
19
20    pub fn create_clear_response() -> String {
21        crate::i18n::get_translation("system.input.history_cleared", &[])
22    }
23}