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

Function read_line

std/src/console/readline.rs:484–495  ·  view source on GitHub ↗

Reads a line from the console. If the console is interactive, this does fancy line editing and uses the given `prompt` and pre-fills the input with `previous`.

(
    console: &mut dyn Console,
    prompt: &str,
    previous: &str,
    history: Option<&mut Vec<String>>,
)

Source from the content-addressed store, hash-verified

482/// Reads a line from the console. If the console is interactive, this does fancy line editing and
483/// uses the given `prompt` and pre-fills the input with `previous`.
484pub async fn read_line(
485 console: &mut dyn Console,
486 prompt: &str,
487 previous: &str,
488 history: Option<&mut Vec<String>>,
489) -> io::Result<String> {
490 if console.is_interactive() {
491 read_line_interactive(console, prompt, previous, history, true).await
492 } else {
493 read_line_raw(console).await
494 }
495}
496
497/// Reads a line from the console without echo using the given `prompt`.
498///

Callers 6

read_boolMethod · 0.85
async_execMethod · 0.85
continue_if_modifiedFunction · 0.85
editMethod · 0.85
async_execMethod · 0.85
run_repl_loopFunction · 0.85

Calls 3

read_line_interactiveFunction · 0.85
read_line_rawFunction · 0.85
is_interactiveMethod · 0.45

Tested by 1

editMethod · 0.68