add_ed/io/
dummy_io.rs

1use crate::{
2  io::IO,
3  ui::UILock,
4  buffer::iters::LinesIter,
5};
6
7use super::Result;
8
9/// An [`IO`] implementation for when no IO should occur. Intended for non IO
10/// tests.
11pub struct DummyIO {}
12impl DummyIO {
13  pub fn new() -> Self { Self{} }
14}
15
16impl IO for DummyIO {
17  fn run_command(&mut self,
18    _ui: &mut UILock,
19    _command: String,
20  ) -> Result<()> {
21    unimplemented!()
22  }
23  fn run_read_command(&mut self,
24    _ui: &mut UILock,
25    _command: String,
26  ) -> Result<String> {
27    unimplemented!()
28  }
29  fn run_write_command(&mut self,
30    _ui: &mut UILock,
31    _command: String,
32    _input: LinesIter,
33  ) -> Result<usize> {
34    unimplemented!()
35  }
36  fn run_transform_command(&mut self,
37    _ui: &mut UILock,
38    _command: String,
39    _input: LinesIter,
40  ) -> Result<String> {
41    unimplemented!()
42  }
43  fn write_file(&mut self,
44    _path: &str,
45    _append: bool,
46    _data: LinesIter,
47  ) -> Result<usize> {
48    unimplemented!()
49  }
50  fn read_file(&mut self,
51    _path: &str,
52    _must_exist: bool,
53  ) -> Result<String> {
54    unimplemented!()
55  }
56}