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)
| 499 | /// The console must be interactive for this to work, as otherwise we do not have a mechanism to |
| 500 | /// suppress echo. |
| 501 | pub 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)] |
| 509 | mod tests { |