MCPcopy Index your code
hub / github.com/endbasic/endbasic / print

Method print

terminal/src/lib.rs:371–383  ·  view source on GitHub ↗
(&mut self, text: &str)

Source from the content-addressed store, hash-verified

369 }
370
371 fn print(&mut self, text: &str) -> io::Result<()> {
372 let text = remove_control_chars(text.to_owned());
373
374 let stdout = io::stdout();
375 let mut stdout = stdout.lock();
376 stdout.write_all(text.as_bytes())?;
377 if self.is_tty {
378 stdout.write_all(b"\r\n")?;
379 } else {
380 stdout.write_all(b"\n")?;
381 }
382 Ok(())
383 }
384
385 async fn poll_key(&mut self) -> io::Result<Option<Key>> {
386 (self as &mut dyn InputOps).poll_key().await

Callers

nothing calls this directly

Calls 2

remove_control_charsFunction · 0.85
as_bytesMethod · 0.80

Tested by

no test coverage detected