pub fn run<'a>(
input: &mut Input,
history: &mut History,
stdout: &mut StdoutLock<'static>,
user_input: &'a mut String,
) -> StringExamples found in repository?
examples/default.rs (line 9)
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
fn main() {
// enter raw mode and initialize necessary variables
let (mut sol, mut i, mut h, mut ui) = init();
'main: loop {
// catch and handle user actions,
// if input was submitted bind its value to input var
let input = run(&mut i, &mut h, &mut sol, &mut ui);
// reset user input to empty string
if !input.is_empty() {
// do some stuff with the user input
ui.clear();
}
}
}