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

Function read_line_secure

std/src/console/readline.rs:501–506  ·  view source on GitHub ↗

Reads a line from the console without echo using the given `prompt`. The console must be interactive for this to work, as otherwise we do not have a mechanism to suppress echo.

(console: &mut dyn Console, prompt: &str)

Source from the content-addressed store, hash-verified

499/// The console must be interactive for this to work, as otherwise we do not have a mechanism to
500/// suppress echo.
501pub async fn read_line_secure(console: &mut dyn Console, prompt: &str) -> io::Result<String> {
502 if !console.is_interactive() {
503 return Err(io::Error::other("Cannot read secure strings from a raw console".to_owned()));
504 }
505 read_line_interactive(console, prompt, "", None, false).await
506}
507
508#[cfg(test)]
509mod tests {

Calls 2

read_line_interactiveFunction · 0.85
is_interactiveMethod · 0.45