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

Function read_line_interactive

std/src/console/readline.rs:437–445  ·  view source on GitHub ↗

Reads a line of text interactively from the console, using the given `prompt` and pre-filling the input with `previous`. If `history` is not `None`, then this appends the newly entered line into the history and allows navigating through it.

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

Source from the content-addressed store, hash-verified

435/// the input with `previous`. If `history` is not `None`, then this appends the newly entered line
436/// into the history and allows navigating through it.
437async fn read_line_interactive(
438 console: &mut dyn Console,
439 prompt: &str,
440 previous: &str,
441 mut history: Option<&mut Vec<String>>,
442 echo: bool,
443) -> io::Result<String> {
444 Readline::new(console, prompt, previous, history.take(), echo)?.run().await
445}
446
447/// Reads a line of text interactively from the console, which is not expected to be a TTY.
448async fn read_line_raw(console: &mut dyn Console) -> io::Result<String> {

Callers 4

read_lineFunction · 0.85
read_line_secureFunction · 0.85
acceptMethod · 0.85
expect_errMethod · 0.85

Calls 1

runMethod · 0.45

Tested by

no test coverage detected