Returns a textual description of the size of the console.
(&self)
| 243 | |
| 244 | /// Returns a textual description of the size of the console. |
| 245 | pub fn size_description(&self) -> String { |
| 246 | let pixels = match self.console.size_pixels() { |
| 247 | Ok(size) => size, |
| 248 | Err(e) => panic!("Failed to get console size in pixels: {}", e), |
| 249 | }; |
| 250 | let chars = match self.console.size_chars() { |
| 251 | Ok(size) => size, |
| 252 | Err(e) => panic!("Failed to get console size in chars: {}", e), |
| 253 | }; |
| 254 | format!("{}x{} pixels, {}x{} chars", pixels.width, pixels.height, chars.x, chars.y) |
| 255 | } |
| 256 | |
| 257 | /// Safe version of `run_repl_loop` that is able to return errors. |
| 258 | async fn safe_run_repl_loop(self) -> io::Result<()> { |
no test coverage detected