(&mut self, terminal: &mut Terminal<B>)
| 20 | } |
| 21 | |
| 22 | pub fn run<B>(&mut self, terminal: &mut Terminal<B>) -> io::Result<()> |
| 23 | where |
| 24 | B: Backend, |
| 25 | { |
| 26 | while !self.state.should_quit { |
| 27 | #[cfg(test)] |
| 28 | { |
| 29 | self.state.should_quit = true; |
| 30 | } |
| 31 | terminal.draw(|f| view::render(&self.state, f))?; |
| 32 | // Handle input (this may update scrolling, reload, etc.) |
| 33 | controller::handle_input(&mut self.state)?; |
| 34 | } |
| 35 | Ok(()) |
| 36 | } |
| 37 | } |