MCPcopy Create free account
hub / github.com/endbasic/endbasic / size_description

Method size_description

web/src/lib.rs:245–255  ·  view source on GitHub ↗

Returns a textual description of the size of the console.

(&self)

Source from the content-addressed store, hash-verified

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<()> {

Callers 1

index.jsFile · 0.80

Calls 2

size_pixelsMethod · 0.45
size_charsMethod · 0.45

Tested by

no test coverage detected