use systemd_ask_password_agent; use futures::StreamExt; #[tokio::main(flavor = "current_thread")] async fn main() -> Result<(), Box> { let mut stream = systemd_ask_password_agent::system_requests()?; while let Some(r) = stream.next().await { eprint!("{}: ", r.message); let mut buf = String::new(); std::io::stdin().read_line(&mut buf)?; let x = buf.trim_end_matches('\n'); let res = r.reply(x).await; if let Err(e) = res { eprintln!("Error replying: {e}"); } } return Ok(()) }