blob: f9d262d5b35cf1138e2c3232cad7ebc6487335be (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
use rustyline::history::{History, MemHistory};
pub struct CommandLineContext {
history: MemHistory,
}
impl std::default::Default for CommandLineContext {
fn default() -> Self {
Self {
history: MemHistory::new(),
}
}
}
impl CommandLineContext {
pub fn new() -> Self {
Self::default()
}
pub fn history_ref(&self) -> &dyn History {
&self.history
}
pub fn history_mut(&mut self) -> &mut dyn History {
&mut self.history
}
}
|